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

Cypress forces an invalid moduleResolution value for Typescript 5.7.3; it is unable to start #30954

Open
stevematney opened this issue Jan 27, 2025 · 7 comments
Assignees
Labels
stage: needs information Not enough info to reproduce the issue topic: typescript v14.0.0 🐛 Issue present since 14.0.0

Comments

@stevematney
Copy link

stevematney commented Jan 27, 2025

Current behavior

Because of the forced moduleResolution value in #28709, Typescript 5.7.3 fails saying that "node" is not a valid "moduleResolution" value. (It was deprecated: moduleResolution docs).

The specific text of the failure is:

Error: Debug Failure. Unexpected moduleResolution: node

Note: this seems to only happen when a project is freshly updated to cypress@14 and [email protected]. It seems to be, if Cypress has been run successfully on a previous TS version, it continues working. (This may not be precisely correct, as the exact conditions of the failure have been difficult to pin down.)

Desired behavior

Cypress should default to a current, valid moduleResolution value

Test code to reproduce

This should be reproducible by simply updating any Cypress project using typescript to using [email protected]

Cypress Version

14.0.0

Node version

v22.13.0

Operating System

macOS 15.2

Debug Logs

Other

No response

@jennifer-shehane jennifer-shehane added topic: typescript v14.0.0 🐛 Issue present since 14.0.0 stage: needs investigating Someone from Cypress needs to look at this labels Jan 27, 2025
@jennifer-shehane
Copy link
Member

@stevematney Where are you seeing the error exactly? What were the steps you did after setting these versions?

@jennifer-shehane jennifer-shehane added stage: needs information Not enough info to reproduce the issue and removed stage: needs investigating Someone from Cypress needs to look at this labels Jan 27, 2025
@stevematney
Copy link
Author

@stevematney Where are you seeing the error exactly? What were the steps you did after setting these versions?

Hi @jennifer-shehane! I updated a project from cypress@13 to cypress@14, and updated from [email protected] to [email protected].

I think this has something to do with my module and moduleResolution settings in the tsconfig, and how cypress modifies that at runtime. I'm using "module": "esnext" and "moduleResolution": "bundler". It seems a bit difficult to reproduce locally because, after I have successfully run it once, it continues to work, even after I update my tsconfig values to something that may not have worked before—so likely something that Cypress puts on disk allows it to continue functioning—but when I try to run the same thing in CI, it fails with the above error.

@jennifer-shehane
Copy link
Member

@stevematney After upgrading the versions, you're running cypress run or cypress open? Where are the errors displaying?

@stevematney
Copy link
Author

After upgrading the versions, you're running cypress run or cypress open? Where are the errors displaying?

The errors display in both cases. They display on cypress open if the cypress version is a fresh install on the machine. They display on cypress run in CI.

@stevematney
Copy link
Author

Just one more note: I found that running cypress cache clear gets me to the point where I can reproduce this locally, as well.

@AtofStryker
Copy link
Contributor

Hi @stevematney. I am trying to reproduce this issue in https://github.com/AtofStryker/cypress-issue-30954 but am unable to reproduce. I have tried clearing the cache as well and using the tsconfig values you have provided in the issue. Would you be able to guide me in reproducing the issue in that github repository or helping me fill in the blanks?

@stevematney
Copy link
Author

@AtofStryker I can try to take a look at your reproduction repo soon! I'm not actually sure the precise config that is needed to get it to happen, but it is currently reproducible every time in this repo on the main branch:
https://github.com/WTW-IM/es-components/actions/runs/13017167681/job/36309109594#step:7:27

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage: needs information Not enough info to reproduce the issue topic: typescript v14.0.0 🐛 Issue present since 14.0.0
Projects
None yet
Development

No branches or pull requests

3 participants