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

make error.message enumerable #9440

Merged
merged 4 commits into from
Mar 29, 2023
Merged

make error.message enumerable #9440

merged 4 commits into from
Mar 29, 2023

Conversation

Rich-Harris
Copy link
Member

fixes #9010

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

@changeset-bot
Copy link

changeset-bot bot commented Mar 17, 2023

🦋 Changeset detected

Latest commit: 915d4a7

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

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

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

@benmccann
Copy link
Member

Do we need to manually include err.frame as well or will that one be sent automatically? Not all errors include it, but compile errors do, so you can test by making bad syntax in a svelte template

@Rich-Harris
Copy link
Member Author

I'm having a weirdly hard time reproducing the original error in order to try that out. When I was looking into it the other day though, there's a whole prepareError function that's used internally in Vite for a similar purpose, and if we wanted to add frame etc then we may as well lobby for that to be exposed so we can use it as well. But I couldn't create a situation in which an error with a frame would be created, so I figured that making message enumerable was probably enough. The important thing is that it no longer crashes silently. We could always try and add the extra fields later if we're able to figure out a situation in which they're relevant

@dummdidumm dummdidumm merged commit ae6ddad into master Mar 29, 2023
@dummdidumm dummdidumm deleted the gh-9010 branch March 29, 2023 11:50
@github-actions github-actions bot mentioned this pull request Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vite ErrorOverlay TypeError
3 participants