fix(ssr): preserve fetchModule error details#18626
Merged
patak-cat merged 1 commit intovitejs:mainfrom Nov 11, 2024
Merged
Conversation
hi-ogawa
commented
Nov 9, 2024
| name: error.name, | ||
| message: error.message, | ||
| stack: error.stack, | ||
| ...error, // preserve enumerable properties such as RollupError.loc, frame, plugin |
Contributor
Author
There was a problem hiding this comment.
Alternatively we can return Error instance directly { e: error } and let each transport implementation deal with it. This works for default ssr runner, but for others using JSON.stringify, it'll end up empty since JSON.stringify(new Error("hmm")) === '{}', so it's certainly a minor inconvenience for them.
commit: |
sapphi-red
approved these changes
Nov 11, 2024
patak-cat
approved these changes
Nov 11, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
While investigating the other fix #18621, I realized new transport (introduced in #18362) is not preserving some error properties such as
RollupError.loc, frame, which is useful for error overlay.Error overlay screenshots