Next.js Discord

Discord Forum

API

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

3 Replies

Avatar
Willow PtarmiganOP
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
joulev & fuma pray for Schneider
i think the best way here is to open a github issue
Answer
Avatar
Willow PtarmiganOP
Perfect, thank you @joulev & fuma pray for Schneider . I've added it here https://github.com/vercel/next.js/issues/55281.