Open Vojteggg opened 10 months ago
Also, when i try using the commands npm ci && npm run build it gives me weird error: Build error occurred
ReferenceError: window is not defined at getOrCreateDataLayer (file:///home/runner/work/CookBook/CookBook/node_modules/@firebase/analytics/dist/esm/index.esm2017.js:177:23) at factory (file:///home/runner/work/CookBook/CookBook/node_modules/@firebase/analytics/dist/esm/index.esm2017.js:1038:9) at Component.instanceFactory (file:///home/runner/work/CookBook/CookBook/node_modules/@firebase/analytics/dist/esm/index.esm2017.js:1245:16) at Provider.getOrInitializeService (file:///home/runner/work/CookBook/CookBook/node_modules/@firebase/component/dist/esm/index.esm2017.js:290:39) at Provider.initialize (file:///home/runner/work/CookBook/CookBook/node_modules/@firebase/component/dist/esm/index.esm2017.js:234:31) at initializeAnalytics (file:///home/runner/work/CookBook/CookBook/node_modules/@firebase/analytics/dist/esm/index.esm2017.js:1087:49) at getAnalytics (file:///home/runner/work/CookBook/CookBook/node_modules/@firebase/analytics/dist/esm/index.esm2017.js:1066:12) at /home/runner/work/CookBook/CookBook/.next/server/pages/index.js:1:1935 Error: Failed to collect page data for / at /home/runner/work/CookBook/CookBook/node_modules/next/dist/build/utils.js:1217:15 *** type: 'Error'
Error: Process completed with exit code 1.
Link to the code that reproduces this issue
https://github.com/Vojteggg/CookBook
To Reproduce
I have the default next.js app, from the tutorial, and I want to host it on firebase, I did firebase init hosting, and everything worked, but then I wanted to add github in between, so I ran firebase init hosting:github, configured it with running the npm run build only. When the script starts running on github it gives me an error that the command next was not found. And yes, I installed specifically node, next using npm inside of the app folder. Also I tried removing the node_modules and adding it again, but nothing seem to work/nor change anything inside the app. The error: Run npm run build
build next build
sh: 1: next: not found Error: Process completed with exit code 127.
Also when tried running npx next run it gives this error: Invalid project directory provided, no such directory: app_folder/run
I want it to be hosted on Google as it is for a school project, and teacher wants it to be firebase.
Current vs. Expected behavior
Dropping weird errors, while it should just deploy the site, the rest of the script works all good.
Verify canary release
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure
Additional context
No response