bridge: [unhandledRejection] Cannot set headers after they are sent to the client
Environment
- Operating System: `Darwin`
- Node Version: `v14.18.1`
- Nuxt Version: `2.16.0-27266415.3ab12f9f`
- Package Manager: `yarn@1.22.15`
- Bundler: `Webpack`
- User Config: `head`, `css`, `plugins`, `components`, `buildModules`, `modules`, `build`
- Runtime Modules: `-`
- Build Modules: `@nuxt/bridge@3.0.0-27266907.929a634`
Describe the bug
ERROR [unhandledRejection] Cannot set headers after they are sent to the client 14:23:45
at new NodeError (internal/errors.js:322:7)
at ServerResponse.setHeader (_http_outgoing.js:561:11)
at send (node_modules/webpack-dev-middleware/dist/utils/compatibleAPI.js:68:7)
at processRequest (node_modules/webpack-dev-middleware/dist/middleware.js:186:31)
at ready (node_modules/webpack-dev-middleware/dist/utils/ready.js:11:12)
at Object.middleware (node_modules/webpack-dev-middleware/dist/middleware.js:44:24)
at node_modules/pify/index.js:33:11
at new Promise (<anonymous>)
at Object.<anonymous> (node_modules/pify/index.js:6:9)
at Object.apply (node_modules/pify/index.js:80:20)
at WebpackBundler.middleware (node_modules/@nuxt/webpack-edge/dist/webpack.js:1909:37)
at middleware (node_modules/@nuxt/nitro/dist/index.mjs:1809:50)
at node_modules/h3/dist/index.mjs:111:24
at new Promise (<anonymous>)
at callHandle (node_modules/h3/dist/index.mjs:108:10)
at Object.handle (node_modules/h3/dist/index.mjs:104:12)
Reproduction
Fresh install nuxt 2 and migrate to bridge following: https://v3.nuxtjs.org/getting-started/bridge
Additional context
No response
Logs
No response
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 16 (6 by maintainers)
Same problem here.
Same issue while using Mac OS on Apple Silicon. I do not have the same issue on Ubuntu or Windows.
I’m closing this as this should be resolved with https://github.com/nuxt/bridge/pull/324. If you encounter this again, feel free to open a new issue with a reproduction.
This is not bug only in Nuxt 2 bridge, this hapnes in Nuxt 3 too, when you use Nuxt under reverse proxy (descripted by @Diizzayy here https://github.com/nuxt/nuxt.js/issues/12003), Nitro, h3 or some base server logic in Nuxt part not process headers properly. @danielroe @pi0
When i use my MacBook i got this error, but if i use ubuntu os it’s work fine! I think this error in nodejs base macOS. Because of, do reproduction almost impossible.