-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Cannot set headers after they are sent to the client error occurs a lot #4246
Comments
8 days later this has risen to 74k occurrences. Can someone confirm if the code I wrote is a good temporary fix so I don't have over 100k occurrences next week. |
@gibkigonzo please take a look |
@1070rik Yes, there shouldn't be
if |
@gibkigonzo How would I be able to fix this until 1.11.4 gets released? I fixed the errorhandler method but the error still occurs (probably caused by the afterOutputRenderedResponse part like you mentioned?). |
i also get these on API side... dunno if releated... vuestorefront/vue-storefront-api#434 |
@1070rik Can you send your config? just the part that you changed (local.json). It will help to reproduce your context and track this problem. |
@gibkigonzo yeah sure. Here you go.
|
Current behavior
Currently in our bug tracking software we see this error a lot. (47k occurrences in like 3 weeks)
It seems to happen when a 404 or error page gets rendered according to the error.
Don't know if I'm correct but if you do a
res.redirect
or something like that, you need to do a return after that so it doesn't try to do another redirect?So if you would want to do a 404 or 500 redirect the errorHandler in server.ts would look like this:
I don't have a lot of experience with express so I might be wrong.
Expected behavior
It shouldn't happen at all.
Steps to reproduce the issue
Run VSF in a production environment.
Repository
Can you handle fixing this bug by yourself?
Which Release Cycle state this refers to? Info for developer.
Pick one option.
develop
branch and create Pull Request2. Feature / Improvement
back todevelop
.release
branch and create Pull Request3. Stabilisation fix
back torelease
.hotfix
ormaster
branch and create Pull Request4. Hotfix
back tohotfix
.Environment details
Additional information
The text was updated successfully, but these errors were encountered: