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

Better errors for when response is already sent #6719

Merged
merged 4 commits into from
Mar 31, 2023
Merged

Conversation

matthewp
Copy link
Contributor

@matthewp matthewp commented Mar 31, 2023

Changes

Testing

  • Unit test added for cookies.
  • SSR test added for redirects

Docs

N/A, error message

@matthewp matthewp requested a review from a team as a code owner March 31, 2023 15:36
@changeset-bot
Copy link

changeset-bot bot commented Mar 31, 2023

🦋 Changeset detected

Latest commit: ccd265f

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Mar 31, 2023
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Docs-approved error message! 🥳

ResponseSentError: {
title: 'Unable to set response',
code: 9004,
message: 'The response has already been sent to the browser and cannot be altered.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful message. Docs is happy!

@matthewp matthewp merged commit d54cbe4 into main Mar 31, 2023
@matthewp matthewp deleted the set-cookies-late branch March 31, 2023 19:27
@astrobot-houston astrobot-houston mentioned this pull request Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unclear Astro.redirect behavior in SSR Response cookies can't be set when page is .astro
3 participants