Skip to content

feat: expose ssrRewriteStacktrace#7091

Merged
patak-cat merged 1 commit intovitejs:mainfrom
benmccann:ssrRewriteStacktrace
Mar 11, 2022
Merged

feat: expose ssrRewriteStacktrace#7091
patak-cat merged 1 commit intovitejs:mainfrom
benmccann:ssrRewriteStacktrace

Conversation

@benmccann
Copy link
Copy Markdown
Collaborator

@benmccann benmccann commented Feb 25, 2022

Description

Closes #7045

Additional context

We'd like to get the corrected stacktrace without mutating the original error because we handle certain errors in multiple locations. We can currently workaround this by storing and then resetting the original stack trace, but this would be a much cleaner solution


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@benmccann benmccann added feat: ssr p2-nice-to-have Not breaking anything but nice to have (priority) labels Feb 25, 2022
@patak-cat
Copy link
Copy Markdown
Member

@benmccann just to confirm, is this still needed after merging #7048?

@benmccann
Copy link
Copy Markdown
Collaborator Author

benmccann commented Feb 25, 2022

Yes, neither change obviates the desire for the other. I wasn't aware that there was a second issue that Rich had run into until now or I might have either put them in a single PR or better described the relationship between them.

@bluwy
Copy link
Copy Markdown
Member

bluwy commented Feb 25, 2022

For reference of why this is needed even with #7048, in SvelteKit there may be places where the stacktrace may be fixed twice too (outside of Vite), so having a non-mutable function to fix the stack trace helps avoid the hack mentioned in the issue.

bluwy
bluwy previously approved these changes Feb 26, 2022
@patak-cat patak-cat merged commit d4ae45d into vitejs:main Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat: ssr p2-nice-to-have Not breaking anything but nice to have (priority)

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

Expose ssrRewriteStacktrace

3 participants