0

I am trying to upload my website to netlify and i keep getting this error.

 Compiled successfully
8:10:58 PM: info  - Collecting page data...
8:11:03 PM: > Build optimization failed: found pages without a React Component as default export in
8:11:03 PM: pages/config/firebase-config
8:11:03 PM: pages/helpers/helpers
8:11:03 PM: See https://nextjs.org/docs/messages/page-without-valid-component for more info.
8:11:03 PM: ​
8:11:03 PM: ────────────────────────────────────────────────────────────────
8:11:03 PM:   "build.command" failed                                        
8:11:03 PM: ────────────────────────────────────────────────────────────────
8:11:03 PM: ​
8:11:03 PM:   Error message
8:11:03 PM:   Command failed with exit code 1: npm run build (https://ntl.fyi/exit-code-1)
8:11:03 PM: ​
8:11:03 PM:   Error location
8:11:03 PM:   In Build command from Netlify app:
8:11:03 PM:   npm run build
8:11:03 PM: 

import { createContext } from "react";

    export const AppContext = createContext(null);

    //This is my helpers file, it is inside a component folder not the pages folder.

I found this Can't build React/Next project - found page without a React Component as default export (context api file) as the general explanation, but when i try it, it's not working for me, What's the solution please??

Mayowa
  • 41
  • 5

0 Answers0