-
Notifications
You must be signed in to change notification settings - Fork 992
NextJS emulators:start --only functions,hosting bug #3055
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
Comments
Would you mind trying |
@jasdevsidhu12 in addition to the logs @yuchenshi requested can you show your |
Hi @yuchenshi thanks for replying quick :) Hi @samtstern here's my firebase.json file https://github.com/jasdevsidhu12/test-next/blob/firebase-issue/firebase.json |
@jasdevsidhu12 if you look at your {
"hosting": {
"public": "server/dist", This means Firebase Hosting (in prod and when emulated) will serve the contents of So while developing you should continue to use the NextJS dev server. If you want to test before deploying first build your website for production so it's in There's some discussion of this issue here: You may be able to point the Next.js dev server at |
Hi @samtstern, My express-server is using the firebase cloud-function/hosting name helloWorld [line 20] to "run on". The cloud-function name is also stated in my firebase.json file [line 7]. So when I run my express-server/cloud-functions/hosting locally using However, if I run my express-server only without using cloud-functions/hosting it works without any issues(images below) . Moreover the same express-server/cloud-functions/hosting is what I deployed to my firebase |
Can you show the full request and response (url, headers, data, etc) from the Also it looks like you're trying to send You need to add something like this: "hosting": {
// ...
// Add the "rewrites" attribute within "hosting"
"rewrites": [ {
"source": "/test",
"function": "helloWorld"
} ]
} |
Hi folks. I was able to replicate this issue and I think the root cause is similar to #3052. When the hosting emulator is streaming a response, there's a case where the caller may be expecting compressed content and the proxy is decompressing the content and streaming that back as a response. This causes issues where it can't decompress the content (because it's not compressed) and the content looks truncated (because it's coming back with a content-length of the compressed response rather than the raw response. I'm working on a PR that should address this issue (I was able to verify that the fix worked in this case too, if I remember yesterday correctly). I'm making sure to add some tests to make sure it's behaving as expected, too. Thanks for your patience. |
@bkendall thanks for watching this thread! |
Hi There,
The following is my branch and I'm trying to create a simple firebase cloud "hosting, functions" for my NextJS application.
Repo
https://github.com/jasdevsidhu12/test-next
Branch
firebase-issue
For the whole of last week I kept trying and trying but I couldn't figure it out why
firebase emulators:start --only functions,hosting
wouldn't work butfirebase deploy --only functions,hosting
worked.Result of


firebase emulators:start --only functions,hosting
firebase-debug.log(No errors shown)
Result of

firebase deploy --only functions,hosting
To replicate bug
clone the Repo
npm run serve
The text was updated successfully, but these errors were encountered: