Skip to content

devinant/cypress-ts6

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cypress + TypeScript 6 Deprecation Error (Minimal Reproduction)

This repository reproduces a TypeScript 6.x deprecation error that occurs when running Cypress tests.

Environment

  • Cypress: 10.15.0
  • Typescript: 6.0.0-dev.20260218 (6.0-beta)
  • node: 20.19.0

Summary

Running Cypress with TypeScript 6+ results in deprecation errors:

Oops...we found an error preparing this test file:

  > cypress/support/e2e.ts

The error was:

Error: Webpack Compilation Error
[tsl] ERROR
      TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

[tsl] ERROR
      TS5107: Option 'moduleResolution=classic' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

[tsl] ERROR
      TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

[tsl] ERROR
      TS5107: Option 'moduleResolution=classic' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

[tsl] ERROR
      TS5101: Option 'downlevelIteration' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.

[tsl] ERROR
      TS5107: Option 'moduleResolution=classic' is deprecated and will stop functioning in TypeScript 7.0. Specify compilerOption '"ignoreDeprecations": "6.0"' to silence this error.
    at handle (/Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/@cypress/webpack-preprocessor/dist/index.js:296:23)
    at finalCallback (/Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:500:32)
    at /Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:578:17
    at /Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/HookWebpackError.js:67:2
    at Hook.eval [as callAsync] (eval at create (/Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
    at Cache.storeBuildDependencies (/Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Cache.js:126:37)
    at /Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:574:19
    at Hook.eval [as callAsync] (eval at create (/Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
    at /Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:570:23
    at Compiler.emitRecords (/Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:1046:4)
    at /Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:560:11
    at /Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:1009:14
    at Hook.eval [as callAsync] (eval at create (/Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:6:1)
    at Hook.CALL_ASYNC_DELEGATE [as _callAsync] (/Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/tapable/lib/Hook.js:18:14)
    at /Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:1006:27
    at /Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:2818:7
    at done (/Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/neo-async/async.js:3522:9)
    at alreadyWritten (/Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:811:8)
    at /Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/webpack/lib/Compiler.js:922:17
    at /Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/node_modules/graceful-fs/graceful-fs.js:123:16
    at /Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:123:16
    at /Users/dino/Library/Caches/Cypress/15.10.0/Cypress.app/Contents/Resources/app/packages/server/node_modules/graceful-fs/graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read/context:68:3)

This occurred while Cypress was compiling and bundling your test code. This is usually caused by:

- A missing file or dependency
- A syntax error in the file or one of its dependencies

Fix the error in your code and re-run your tests.

These options (moduleResolution and downlevelIteration) are not explicitly configured in cypress/tsconfig.json.

Minimal reproduction

This issue can be reproduced with the following commands:

npm install
npx cypress run --spec "cypress/e2e/1-getting-started/todo.cy.js"

No additioanl configuration is required.

Expected behaviour

Cypress should not inject downlevelIteration when using target: "es6". Cypress should also avoid moduleResolution: "classic" as its usage has been discouraged.

Actual behaviour

Cypress test run fails due to the typescript compiler emitting errors (see above).

Temporary workaround

Adding the following to the Cypress tsconfig.json supresses the error:

{
  "compilerOptions": {
+   "ignoreDeprecations": "6.0",
    "target": "es6",
    "lib": ["es6", "dom"],
    "sourceMap": true,
    "types": ["cypress", "node"]
  }
}

About

This repository reproduces a TypeScript 6.x deprecation error that occurs when running Cypress tests.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors