-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cypress + Vite 5 + Typescript: exports is not defined in ES module scope #30313
Comments
You can try the suggestion from that issue and add the following directly to the top of "compilerOptions": {
"module": "ES2015"
}
{
"compilerOptions": {
"module": "ESNext"
},
"files": [],
"references": [
{ "path": "./tsconfig.app.json" },
{ "path": "./tsconfig.node.json" }
]
} An alternative workaround is to rename |
Thank you very much, add module worked. Sorry for the repetition. |
It's good to hear that the configuration worked for you!
No problem! You should be able to close this issue now using the button below ⬇️ |
I don't believe this issue should be closed, as this issue indicates that cypress will not accept the TypeScript configuration from any tsconfig files unless they are named specifically Shouldn't it read the configuration from |
I agree with @iacullo-atri, adding |
Current behavior
When I try to start cypress in a vite 5 project with typescript the console returns this error:

I think it is due to cypress having problems with the tsconfig.json structure created by vite.
I added cypress.config.ts inside include in tsconfig.app.josn, but even putting it in tsconfig.node.json the result does not change.
The 3 tsconfigs you will find I did not create, but are the basic vite react configuration (npm create vite@latest my-vue-app -- --template react-ts ). I just created the cypress setup with npx cypress open and, right away, the error appeared that referred to the cypress configuration.
Desired behavior
I would like to be able to run cypress in a newly created vite 5 project
Test code to reproduce
Repo
https://github.com/NormalCrazy000/vite5-Cypress.git
Steps to replicate
Cypress Version
13.15.0
Node version
18.19.1
Operating System
Windows
Debug Logs
No response
Other
No response
The text was updated successfully, but these errors were encountered: