Repository navigation
Description
[REQUIRED] Environment info
firebase-tools: 12.3.0
Platform: Windows
[REQUIRED] Test case
[REQUIRED] Steps to reproduce
npx create-next-app@latest .
- Typescript: Yes
- Eslint: Yes
- TailwindCSS: No
- src directory: No
- app router: No
firebase init
Choose:
-
Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys
-
Emulators: Set up local emulators for Firebase products
-
Detected an existing Next.js codebase in the current directory, should we use this? Yes
-
In which region would you like to host server-side content, if applicable? europe-west1 (Belgium)
-
Set up automatic builds and deploys with GitHub? No
-
Which Firebase emulators do you want to set up? Hosting emulator
-
Which port do you want to use for the hosting emulator? 5000
-
Would you like to enable the Emulator UI? Yes
-
Which port do you want to use for the Emulator UI (leave empty to use any available port)?
-
Would you like to download the emulators now? Yes
firebase emulators:start
Emulator│ Host:Port
Hosting │ 127.0.0.1:5000
[REQUIRED] Expected behavior
The server will stay running once I open 127.0.0.1:5000
[REQUIRED] Actual behavior
Error [ERR_HTTP_HEADERS_SENT]: Cannot render headers after they are sent to the client
Error: An unexpected error has occurred.
- error uncaughtException: Error [ERR_STREAM_WRITE_AFTER_END]: write after end
And the server crashed.
[debug] [2023-06-04T07:35:29.740Z] Error [ERR_STREAM_WRITE_AFTER_END]: write after end
at new NodeError (node:internal/errors:399:5)
at ServerResponse.end (node:_http_outgoing:1010:15)
at ServerResponse.end (C:\Users\User\Desktop\nextfire\node_modules\next\dist\compiled\compression\index.js:22:783)
at Responder.handleError (C:\Users\User\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\superstatic\lib\responder.js:96:14)
at C:\Users\User\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\superstatic\lib\middleware\files.js:142:29
[error]
[error] Error: An unexpected error has occurred.
Activity
google-oss-bot commentedon Jun 4, 2023
This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.
aalej commentedon Jun 5, 2023
Thanks for reporting this @kevinnammour. I was able to reproduce the error using the steps you provided. I was able to start the emulator, but after accessing
127.0.0.1:5000, it throws an error and the emulator stops running.I’ll notify our team about this so that we can investigate this issue. I'll also be marking this as reproducible.
I am using the following to replicate the issue:
alexastrum commentedon Jun 14, 2023
We're working on a fix for this issue.
In the meantime, please use firebase-tools v12.1
leoortizz commentedon Jun 27, 2023
@kevinnammour this issue was fixed by #6005 and will be available in the next release