Skip to content
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

Bug: "Cannot set headers after they are sent to the client" #39

Open
sbue opened this issue Jul 21, 2022 · 1 comment
Open

Bug: "Cannot set headers after they are sent to the client" #39

sbue opened this issue Jul 21, 2022 · 1 comment

Comments

@sbue
Copy link

sbue commented Jul 21, 2022

Hey all, anyone come across this issue? Not sure how to reproduce / where to start

listenerMiddleware/error Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
    at new NodeError (node:internal/errors:372:5)
    at Proxy.setHeader (node:_http_outgoing:576:11)
    at Object.setCookie (/Users/username/project/node_modules/nookies/dist/index.js:89:17)
    at StateCookies.set (/Users/username/project/node_modules/next-redux-cookie-wrapper/dist/next-redux-cookie-wrapper.cjs.development.js:217:13)
    at /Users/username/project/node_modules/next-redux-cookie-wrapper/dist/next-redux-cookie-wrapper.cjs.development.js:386:29
    at /Users/username/project/node_modules/next-redux-cookie-wrapper/dist/next-redux-cookie-wrapper.cjs.development.js:250:22
    at Immer.produce (/Users/username/project/node_modules/immer/dist/immer.cjs.development.js:792:20)
    at walkState (/Users/username/project/node_modules/next-redux-cookie-wrapper/dist/next-redux-cookie-wrapper.cjs.development.js:246:11)
    at /Users/username/project/node_modules/next-redux-cookie-wrapper/dist/next-redux-cookie-wrapper.cjs.development.js:382:17
    at /Users/username/project/node_modules/@reduxjs/toolkit/dist/redux-toolkit.cjs.development.js:1792:22 {
  code: 'ERR_HTTP_HEADERS_SENT'
} { raisedBy: 'effect' }
@bjoluc
Copy link
Owner

bjoluc commented Jul 23, 2022

Hi @sbue,

I remember #25 was related to this. My answer there should apply to you as well. I'll think about preventing this error and logging a helpful error message instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants