-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Labels
prevent-stalemark an issue so it is ignored by stale[bot]mark an issue so it is ignored by stale[bot]topic: typescripttype: bug
Description
Current behavior
Cypress is unable to run typescript/esm projects when certain values are set in the tsconfig.json
. This tsconfig.json
does not work with ESM when setting type: "module"
in the package.json
.
{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "es6",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"plugins": [{ "name": "next" }],
"paths": { "@/*": ["./*"] }
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
}
To workaround this issue, either comment out allowJs
or bump the target
to ES6
or greater
Desired behavior
Cypress should be able to run ESM with typescript regardless of the values in my tsconfig.json
Test code to reproduce
https://github.com/AtofStryker/module_reprod_ts
Cypress Version
13.6.2
Node version
v18.15.0
Operating System
macOS 13.5.1 intel
Debug Logs
Useful for debugging:
DEBUG=cypress:lifecycle:ProjectConfigIpc,cypress:server:register-ts-node,cypress:config:addToCypressConfig,cypress:lifecycle:child:run_require_async_child*,cypress:config:addToCypressConfigPlugin npx cypress open
### Other
_No response_
leeuwd
Metadata
Metadata
Assignees
Labels
prevent-stalemark an issue so it is ignored by stale[bot]mark an issue so it is ignored by stale[bot]topic: typescripttype: bug