-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
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
Wrong Source Map for js files in SSR mode #8657
Comments
It seems mappings field is correct (source-map-visualization). So to workaround just delete the incorrect |
Why does it return a content then 🤔 I see there is no Thank you for the workaround! |
I've managed to reproduce the error in Vitest with provided source map. I am not sure, where the error lies tho. Imagine, there are two files with the same content. One is Reproduction: |
I think -const jsPosition = consumerJs.originalPositionFor({ line: 10, column: 81 });
-const tsPosition = consumerTs.originalPositionFor({ line: 8, column: 81 });
+const jsPosition = consumerJs.originalPositionFor({ line: 10, column: 80 });
+const tsPosition = consumerTs.originalPositionFor({ line: 8, column: 80 }); Why ts returns the same value with 80 and 81 is because it points the same segment. |
Describe the bug
When transforming JS files with
server.transformRequest
and enabled SSR flag, it returns invalid source map.sourceContent
includes already processed import paths instead of the original ones.To run code in reproduction:
It was noticed in Vitest, because snapshots rely on source maps: vitest-dev/vitest#1376
Reproduction
https://stackblitz.com/edit/vitejs-vite-pacs84?file=vite-repro.mjs&view=editor
Used Package Manager
npm
Logs
No response
Validations
The text was updated successfully, but these errors were encountered: