Skip to content

Cypress + Vite 5 + Typescript: exports is not defined in ES module scope #5940

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

Closed
1 of 6 tasks
NormalCrazy000 opened this issue Sep 28, 2024 · 3 comments
Closed
1 of 6 tasks

Comments

@NormalCrazy000
Copy link

NormalCrazy000 commented Sep 28, 2024

Description

When I try to start cypress in a vite 5 project with typescript the console returns this error:
Screenshot 2024-09-28 231716
I think it is due to cypress having problems with the tsconfig.json structure created by vite.

URL of Issue(s)

https://github.com/NormalCrazy000/vite5-Cypress.git

Steps to replicate

  1. npm install
  2. npx cypress open

Browser

No response

Device

  • PC
  • Mac
  • iPhone
  • iPad
  • Android Phone
  • Android Tablet

Additional Information

No response

@NormalCrazy000 NormalCrazy000 changed the title Cypress + Vite 5 + Typescript: Cypress : exports is not defined in ES module scope Cypress + Vite 5 + Typescript: exports is not defined in ES module scope Sep 28, 2024
@NormalCrazy000
Copy link
Author

I moved bug repo to the cypress repository

@vikiboss
Copy link

It happened to me, too. It seems to be caused by this line of code:

// package.json
{
  // ...
  "type": "module"
  // ...
}

@MikeMcC399
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants