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

feat: expose ssrRewriteStacktrace #7091

Merged
merged 1 commit into from Mar 11, 2022

Conversation

benmccann
Copy link
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-dev
Copy link
Member

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

@benmccann
Copy link
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
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-dev patak-dev 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