-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 doesn't evaluate "esModuleInterop": true
in cypress/tsconfig.json?
#8359
Comments
"esModuleInterop": true
in cypress/tsconfig.json?
I am able to recreate this behavior in 5.0.0 (although slightly different error msg). Repro
{
"devDependencies": {
"@babel/core": "^7.11.1",
"@babel/preset-env": "^7.11.0",
"@cypress/webpack-preprocessor": "^5.4.4",
"babel-loader": "^8.1.0",
"cypress": "5.0.0",
"typescript": "^3.9.7",
"webpack": "^4.44.1"
}
}
import webpackPreprocessor from "@cypress/webpack-preprocessor";
module.exports = (on, config) => {
on("file:preprocessor", webpackPreprocessor({}));
}
{
"compilerOptions": {
"baseUrl": ".",
"module": "commonjs",
"moduleResolution": "node",
"declaration": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"experimentalDecorators": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"removeComments": true,
"suppressImplicitAnyIndexErrors": true,
"declarationMap": true,
"sourceMap": true,
"target": "es5",
"lib": ["es5", "dom"],
"types": ["cypress"],
"paths": {
"~/*": ["./*"]
}
},
"exclude": ["node_modules"],
"include": ["**/*.ts"]
} 4.12.15.0.0 |
This might be a bug in the webpack preprocessor itself. Its doing a namespace export of a callable, which isn't valid in ES modules AFAIK. Does |
The safest fix would probably be to change the preprocessor to do Unfortunately, thats a breaking change I guess |
Thanks for your investigation!
It doesn't work too. |
It looks like the issue is that the I'm still looking into why that is and working on a fix for it. |
I confirmed the issue is that I'm working on a fix that will now resolve the @tanakaworld In the meantime, a potential workaround is to add |
Thanks! I've confirmed that I think this issue should be fixed because the document says:
|
The code for this is done in cypress-io/cypress#8377, but has yet to be released. |
Released in This comment thread has been locked. If you are still experiencing this issue after upgrading to |
Current behavior:
There is a plugin .ts file.
Then it failed to initialize Cypress.app with the following error.
Desired behavior:
It should work with
import
syntax when"esModuleInterop": true
is in tsconfig.json.Test code to reproduce
The
verify/v5.0.0
branch in this repo. It reproduces the same error.Versions
cypress: v5.0.0
The text was updated successfully, but these errors were encountered: