Skip to content

Evaled UserInvocationStack is sometimes off for projects using Typescript 5 #29614

@AtofStryker

Description

@AtofStryker

Current behavior

Currently, when a user is running cypress commands that are wrapped inside serializable closures that throw errors, the stack trace line/column is slightly off when running typescript 5 projects. This can be seen inside our @packages/app tests when running stack trace validation when validating cy.intercept() stack errors inside reporter.command_errors.cy.ts

in cypress command log (typescript 5)

Screenshot 2024-06-03 at 2 49 17 PM

stack trace when opened in IDE (slight mismatch) (typescript 5)

Screenshot 2024-06-04 at 12 43 22 PM

This was realized when we updated the monorepo to typescript 5. see https://github.com/cypress-io/cypress/pull/29568/files#r1613972217

Desired behavior

The code snippet in the command log should match the stack trace that is visited to the user's IDE

in cypress command log (typescript 4)

Screenshot 2024-06-04 at 12 48 25 PM

stack trace when opened in IDE (slight mismatch) (typescript 4)

Screenshot 2024-06-04 at 12 48 40 PM

Test code to reproduce

see @packages/app tests when running stack trace validation when validating cy.intercept() stack errors inside reporter.command_errors.cy.ts

Cypress Version

13.10.0

Node version

v18.17.1

Operating System

macOS 14.3

Debug Logs

No response

Other

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions