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

Fix error stacktrace from Vite SSR runtime #7273

Merged
merged 3 commits into from
Jun 27, 2023
Merged

Fix error stacktrace from Vite SSR runtime #7273

merged 3 commits into from
Jun 27, 2023

Conversation

bluwy
Copy link
Member

@bluwy bluwy commented Jun 2, 2023

Changes

Part of the fix for #5465

When we call ssrLoadModule to get a module processed by Vite, and call the module's runtime (e.g. it's exported function), we also need to fix the stacktrace there.

Previously we're only fixing the stacktrace when we call ssrLoadModule (module init).

Also, when we call MagicString's generateMap() API, we need to pass hires: true too. Otherwise a low res map combined with another map (for multiple plugin transforms) will degrade the sourcemap accuracy/resolution. Causing offset issues.

Testing

Manually tested with the issues repro

Docs

n/a. bug fix.

@changeset-bot
Copy link

changeset-bot bot commented Jun 2, 2023

🦋 Changeset detected

Latest commit: 6dbf95f

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 Jun 2, 2023
@bluwy bluwy marked this pull request as draft June 2, 2023 09:14
@bluwy
Copy link
Member Author

bluwy commented Jun 2, 2023

Looks like Vite's SSR stacktrace rewrite made the file path worse 👀 Gonna have to look into Vite

@bluwy bluwy mentioned this pull request Jun 2, 2023
1 task
@bluwy bluwy marked this pull request as ready for review June 27, 2023 09:07
@bluwy bluwy merged commit 6dfd708 into main Jun 27, 2023
@bluwy bluwy deleted the ssr-stack-fix branch June 27, 2023 13:16
@astrobot-houston astrobot-houston mentioned this pull request Jun 27, 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.

2 participants