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

Sourcemaps are broken in Cypress in TypeScript version 5 #28483

Open
jennifer-shehane opened this issue Dec 8, 2023 · 4 comments
Open

Sourcemaps are broken in Cypress in TypeScript version 5 #28483

jennifer-shehane opened this issue Dec 8, 2023 · 4 comments
Assignees
Labels
prevent-stale mark an issue so it is ignored by stale[bot] topic: typescript type: bug

Comments

@jennifer-shehane
Copy link
Member

Current behavior

Sourcemaps are broken in some version of TS 5. Something like the behavior below may happen where there is no sourcemap

Screen Shot 2023-12-08 at 1 21 58 PM

Desired behavior

In order to get sourcemaps to work we have to do some monkeypatching to force the sourcemap options to generate them the way we expect. There's likely something that's changed in some version of TS 5 here.

Test code to reproduce

TS code - don't have repro

Cypress Version

13.6.1

Node version

18

Operating System

Mac

Debug Logs

No response

Other

No response

@cypress-app-bot
Copy link
Collaborator

This issue has not had any activity in 180 days. Cypress evolves quickly and the reported behavior should be tested on the latest version of Cypress to verify the behavior is still occurring. It will be closed in 14 days if no updates are provided.

@cypress-app-bot cypress-app-bot added the stale no activity on this issue for a long period label Jun 6, 2024
@TimVee
Copy link

TimVee commented Jun 7, 2024

The line numbers of assertions errors in run mode are still incorrect.

@jennifer-shehane jennifer-shehane added prevent-stale mark an issue so it is ignored by stale[bot] and removed stale no activity on this issue for a long period labels Jun 7, 2024
@ryanthemanuel
Copy link
Collaborator

@TimVee or anyone else following this issue, I've been spending some time looking into this and I'm not able to reproduce this with a couple of scenarios I've tried. Do you have a minimal example of this failing for you that I can take a look at?

@TimVee
Copy link

TimVee commented Dec 19, 2024

I could reproduce it easily:

  1. Created a new project
  2. pnpm init
  3. pnpm add cypress typescript
  4. npx cypress open
  5. Let Cypress scaffold the example test cases
  6. Added tsconfig.json
    {
      "compilerOptions": {
        "target": "ES2018",
        "lib": ["ES2018"],
        "types": [],
        "moduleResolution": "node"
      },
      "include": ["**/*.ts"]
    }
  7. Renamed cypress/e2e/1-getting-started/todo.cy.js to .ts
  8. Added an error in the test.
  9. Ran the test

I added the error on line 24, but in the Cypress test runner that becomes line 21:

Code_v64FczDf04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
prevent-stale mark an issue so it is ignored by stale[bot] topic: typescript type: bug
Projects
None yet
Development

No branches or pull requests

4 participants