Skip to content

Can't deploy site to firebase using npm run build #58763

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
Vojteggg opened this issue Nov 22, 2023 · 3 comments
Closed
1 task done

Can't deploy site to firebase using npm run build #58763

Vojteggg opened this issue Nov 22, 2023 · 3 comments
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.

Comments

@Vojteggg
Copy link

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

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
  Platform: darwin
  Arch: x64
  Version: Darwin Kernel Version 23.0.0: Fri Sep 15 14:42:42 PDT 2023; root:xnu-10002.1.13~1/RELEASE_X86_64
Binaries:
  Node: 21.1.0
  npm: 9.6.7
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.0.3
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: N/A
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure

Additional context

No response

@Vojteggg Vojteggg added the bug Issue was opened via the bug report template. label Nov 22, 2023
@Vojteggg
Copy link
Author

Vojteggg commented Nov 22, 2023

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.

@nextjs-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@nextjs-bot nextjs-bot added the stale The issue has not seen recent activity. label May 20, 2025
@nextjs-bot
Copy link
Collaborator

This issue has been automatically closed due to two years of inactivity. If you’re still experiencing a similar problem or have additional details to share, please open a new issue following our current issue template. Your updated report helps us investigate and address concerns more efficiently. Thank you for your understanding!

@nextjs-bot nextjs-bot closed this as not planned Won't fix, can't repro, duplicate, stale May 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

2 participants