-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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
Fix serve command #3989
Fix serve command #3989
Conversation
From the Firebase docs, you must use --only in order to run the local function emulator. See https://firebase.google.com/docs/functions/local-emulator
Doesn't work without this
@jonjamz Your fork is out of date. I've written comments about this not working and linked to relevant issues in the README - see current canary https://github.com/zeit/next.js/tree/canary/examples/with-firebase-hosting#run-firebase-locally-for-testing I'll look at this again now and see if anything has changed. |
Wow, the local function emulation actually works now! Cheers @jonjamz for bringing this to my attention 😄 Interestingly it still checks online to see if a Firebase project with that name exists within your account, but it certainly runs local functions with hosting rewrites. @jonjamz Once you update to the latest canary the changes that need to occur are: // package.json
+ "preserve": "npm run build-all",
- "serve": "echo \"for details see:\n\thttps://github.com/firebase/firebase-tools/issues/535 \n\thttps://github.com/zeit/next.js/issues/3167\";",
+ "serve": "NODE_ENV=production firebase serve --only functions,hosting",
+ "build-all": "npm run build-public && npm run build-funcs && npm run build-app && npm run copy-deps && npm run install-deps", This would also close this #3167 |
Ha! I actually just did exactly what you did and came back here to write about it but you already had it figured out 😄. Glad it's all working! |
@jonjamz You're still going to need to perform the update to the PR yourself, I don't have write access to your repo. It is exciting though as this significantly reduces the turn around time from writing to testing. You should also update the README.md as so - Unfortunately I have been unable to get any combination of
- firebase serve --only functions,hosting
+ npm run serve
- to locally host the built Next.js app as expected. [This issue is where solutions are being explored](https://github.com/firebase/firebase-tools/issues/535) and they will be shared here and on the [Next.js repo's similar issue](https://github.com/zeit/next.js/issues/3167) when discovered. |
# Conflicts: # examples/with-firebase-hosting/package.json
Fixed the suggestions you mentioned @jthegedus |
From the Firebase docs, you must use --only in order to run the local function emulator.
See https://firebase.google.com/docs/functions/local-emulator