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

Error: Cannot set headers after they are sent to the client #313

Closed
sentry-io bot opened this issue Feb 16, 2025 · 1 comment
Closed

Error: Cannot set headers after they are sent to the client #313

sentry-io bot opened this issue Feb 16, 2025 · 1 comment
Assignees
Labels
bug Issue/PR related to an error, fault, or flaw. high priority Issue/PR is a high priority.

Comments

@sentry-io
Copy link

sentry-io bot commented Feb 16, 2025

Sentry Issue: WEBSITE-8B

Error: Cannot set headers after they are sent to the client
  File "/opt/del/dist/src/Routes/bots.js", line 3248
    return res.status(400).json({
...
(1 additional frame(s) were not displayed)
@sentry-io sentry-io bot added bug Issue/PR related to an error, fault, or flaw. high priority Issue/PR is a high priority. labels Feb 16, 2025
@carolinaisslaying
Copy link
Member

Based off of what I can tell, this happens because in .catch(), it returns return res.status(400).json(), but then outside of the .catch(), there is a res.redirect() for successful events. Will just move res.redirect() to the bottom line within the .then() part.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue/PR related to an error, fault, or flaw. high priority Issue/PR is a high priority.
Projects
None yet
Development

No branches or pull requests

1 participant