-
Notifications
You must be signed in to change notification settings - Fork 3.4k
fix: ensure that absolute paths can be found via source maps #32820
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
base: develop
Are you sure you want to change the base?
Conversation
Add wait time before clicking the error file path.
This took a surgical approach. We:
|
Additional details
Current Cypress code that determines absolute paths assumes that source maps are relative to the project root. This is not true. Users can have a webpack configuration that specifies a new root via the context property. To allow for this, we determine the new root. We do this by treating the spec file as an anchor point since we know it's absolute path. We can then look at the source maps and determine what "relative" is for that spec file. From this, we then calculate what the root is.
Steps to test
How has the user experience changed?
PR Tasks
cypress-documentation?type definitions?Note
Determine and propagate a source map project root to resolve correct absolute file paths and IDE opening, and add targeted sourcemap tests and configs across runners.
source_map_utilsAPIs to extract source maps, set/getprojectRootvia spec anchor, and computegetBaseDirectory.cypress.ts,script_utils,stack_utils,mocha,originandsessionscommands to enhance stacks, invocation details, and file resolution.Cypress.areSourceMapsAvailableandCypress.sourceMapProjectRoot.utils.stripCustomProtocoland update callers.filePaththroughcreateVerifyandverifyIdeOpento assert correct absolute path and IDE open behavior.open:fileevents; scaffold specs undersrc/..mjsconfigs (enabled/disabled and updated sourcemap root) and a new fixture projectrunner-e2e-specs-new-sourcemap-root.Written by Cursor Bugbot for commit 69f79b0. This will update automatically on new commits. Configure here.