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

CT Stacktraces: Investigate Vite sourcemap mismatches #23919

Closed
mike-plummer opened this issue Sep 21, 2022 · 3 comments · Fixed by #24063
Closed

CT Stacktraces: Investigate Vite sourcemap mismatches #23919

mike-plummer opened this issue Sep 21, 2022 · 3 comments · Fixed by #24063
Assignees
Labels
CT Issue related to component testing

Comments

@mike-plummer
Copy link
Contributor

Sourcemaps generated by Vite are often shifted by 1-3 columns, resulting in misaligned code frames (errors point to incorrect part of line that generated the error). This is worked around in current system tests by providing multiple column mappings to accept (see reporter-ct-vite.errors.cy.ts), and at runtime users will sometimes see codeframes that are incorrectly positioned.

Need to investigate whether the sourcemaps themselves are incorrect, or whether we have logic in place that is breaking them due to Webpack-specific behaviors. This typically presents in JS-only files that are not transpiled by Vite (not JSX, TS, etc), so this may indicate an issue with the workaround we've added to vite-dev-server to always serve sourcemaps (see transform function of cypress.ts plugin under vite-dev-server)

@mike-plummer mike-plummer added the CT Issue related to component testing label Sep 21, 2022
@baus
Copy link

baus commented Sep 27, 2022

@mike-plummer mike-plummer self-assigned this Sep 27, 2022
@baus baus changed the title CT Stacktraces: Vite sourcemap mismatches CT Stacktraces: Investigate Vite sourcemap mismatches Sep 27, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 6, 2022

The code for this is done in cypress-io/cypress#24063, but has yet to be released.
We'll update this issue and reference the changelog when it's released.

@cypress-bot
Copy link
Contributor

cypress-bot bot commented Oct 11, 2022

Released in 10.10.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v10.10.0, please open a new issue.

@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Oct 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CT Issue related to component testing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants