TypeScript and package.json type module (ESM) shows "ExperimentalWarning: --experimental-loader
"
#30318
Labels
stage: needs investigating
Someone from Cypress needs to look at this
topic: typescript
type: error message
Current behavior
If
package.json
is configured with Node.js type field set tomodule
(instead of left undefined or set tocommonjs
), Typescript is installed andconfig.cypress.ts
is present, then the following warning is output when running Cypress:Desired behavior
Cypress should not show any warning when set up as a TypeScript project and
package.json
includes"type": "module"
for an ESM project.Test code to reproduce
git clone --branch ts-module https://github.com/MikeMcC399/cypress-test-tiny cd cypress-test-tiny npm ci npx cypress run
Cypress Version
First reported on Cypress version:
13.15.0
Continues to be reproducible on version:
13.15.2
Node version
v20.17.0
LTSOperating System
Ubuntu
24.04.1
LTSDebug Logs
Other
Typescript version:
5.6.2
ERR_INTERNAL_ASSERTION
with Node.js >= v22.1.0 andexperimental-detect-module
set #30101With Node.js 22.11.0 LTS there is an additional warning
which comes from
ts-node
(see issue TypeStrong/ts-node#2116)The text was updated successfully, but these errors were encountered: