Next.js Discord

Discord Forum

API

Answered
David L. Bowman posted this in #help-forum
Open in Discord
Avatar
Next.js doesn't work with Cypress out-of-the-box anymore (recommended documentation).
Answered by joulev
i think the best way here is to open a github issue
View full answer

3 Replies

Avatar
The newest version of Next.js isn't compatible with Cypress out-of-the-box. You need to change the value of "moduleResolution": from "bundler" to "node" in tsconfig.json.
// tsconfig.json
        "module": "esnext",
        "moduleResolution": "node", // Cypress requires bundler => node

This isn't reflected on the Next.js documentation https://nextjs.org/docs/pages/building-your-application/optimizing/testing, although is reflected in the --example with-cypress with-cypress-app https://github.com/vercel/next.js/blob/canary/examples/with-cypress/tsconfig.json. I also needed to add "baseUrl": "./" to my "compilerOptions": { ... } in tsconfig.json.

Do you know how I can reach out to someone at Next's team for Documentation?
Avatar
i think the best way here is to open a github issue
Answer
Avatar
Perfect, thank you @joulev . I've added it here https://github.com/vercel/next.js/issues/55281.