Skip to content
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

Docs: Cypress example doesn't work unless you update the compiler options #56417

Open
digiguru opened this issue Oct 4, 2023 · 0 comments
Open

Comments

@digiguru
Copy link

digiguru commented Oct 4, 2023

What is the improvement or update you wish to see?

Need to update this document because the example doesn't work without further configuration
https://nextjs.org/docs/pages/building-your-application/optimizing/testing

We should advise people to add this config element to their tsconfig.json file in the root node

"ts-node": {
  "compilerOptions": {
    "module": "es2015",
    "moduleResolution": "node"
  }
},

Is there any context that might help us understand?

Out the box the cypress example doesn't work since NextJS has a compiler option set as Bundler. This is incompatible with Cypress but there's a workaround that actually creates a new module resolution type for the node side of the compilation rather than playing with the default settings.

See discussions here and here

As a result we should add the following advice to the following.

"ts-node": {
  "compilerOptions": {
    "module": "es2015",
    "moduleResolution": "node"
  }
},

Does the docs page already exist? Please link to it.

https://nextjs.org/docs/pages/building-your-application/optimizing/testing

@digiguru digiguru added the Documentation Related to Next.js' official documentation. label Oct 4, 2023
@samcx samcx removed the Documentation Related to Next.js' official documentation. label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants