Home

Issue: 3059

NuxtServerError: Can't set headers after they are sent.

[issue link]

How to fix:
{ NuxtServerError: Can’t set headers after they are sent.
at validateHeader (_http_outgoing.js:491:11)
at ServerResponse.setHeader (_http_outgoing.js:498:3)
at Renderer.nuxtMiddleware (/var/www/myweb/node_modules/nuxt/lib/core/middleware/nuxt.js:37:11)
'at
'at process._tickCallback (internal/process/next_tick.js:188:7) statusCode: 500, name: ‘NuxtServerError’ }
0|mywork_d | Error: Can’t set headers after they are sent.
'at validateHeader (_http_outgoing.js:491:11)
'at ServerResponse.setHeader (_http_outgoing.js:498:3)
'at sendResponse (/var/www/myweb/node_modules/nuxt/lib/core/middleware/error.js:20:9)
'at Renderer.errorMiddleware (/var/www/myweb/node_modules/nuxt/lib/core/middleware/error.js:47:5)
'at call (/var/www/myweb/node_modules/connect/index.js:235:7)
'at next (/var/www/myweb/node_modules/connect/index.js:183:5)
'at Renderer.nuxtMiddleware (/var/www/myweb/node_modules/nuxt/lib/core/middleware/nuxt.js:89:5)
'at
'at process._tickCallback (internal/process/next_tick.js:188:7)

Thanks!

This question is available on Nuxt.js community (#c2648)