Skip to content

firebase emulators:start crashing in nextjs app. #5934

@kevinnammour

Description

@kevinnammour

[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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions