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: Next.js & Cypress Out-of-the-Box Documentation #55281

Closed
davidlbowman opened this issue Sep 12, 2023 · 5 comments
Closed

Docs: Next.js & Cypress Out-of-the-Box Documentation #55281

davidlbowman opened this issue Sep 12, 2023 · 5 comments
Labels
Documentation Related to Next.js' official documentation. good first issue Easy to fix issues, good for newcomers locked

Comments

@davidlbowman
Copy link

davidlbowman commented Sep 12, 2023

What is the improvement or update you wish to see?

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.

Also worth mentioning, they recommend you use the script "cypress: open": "cypress open" and not `"cypress": "cypress open". https://docs.cypress.io/guides/getting-started/opening-the-app

Is there any context that might help us understand?

I created the application yesterday using the latest versions of everything.

{
    "name": "next-demo",
    "version": "0.1.0",
    "private": true,
    "scripts": {
        "dev": "next dev",
        "build": "next build",
        "start": "next start",
        "lint": "next lint",
        "cypress:open": "cypress open"
    },
    "dependencies": {
        "@types/node": "20.6.0",
        "@types/react": "18.2.21",
        "@types/react-dom": "18.2.7",
        "autoprefixer": "10.4.15",
        "cypress": "^13.1.0",
        "eslint": "8.49.0",
        "eslint-config-next": "13.4.19",
        "next": "13.4.19",
        "postcss": "8.4.29",
        "react": "18.2.0",
        "react-dom": "18.2.0",
        "tailwindcss": "3.3.3",
        "typescript": "5.2.2"
    }
}

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

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

@davidlbowman davidlbowman added the Documentation Related to Next.js' official documentation. label Sep 12, 2023
@leerob leerob added the good first issue Easy to fix issues, good for newcomers label Sep 17, 2023
@KSSaiTeja
Copy link

i am interested to work on this issue. I would be happy if some more information is provided about the work should be done

@sdkdeepa
Copy link
Contributor

Please see PR raised: #55801

@KSSaiTeja
Copy link

ok thanks for the reply.

@sdkdeepa
Copy link
Contributor

This PR has been merged. Hence we can close this issue.

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation Related to Next.js' official documentation. good first issue Easy to fix issues, good for newcomers locked
Projects
None yet
Development

No branches or pull requests

4 participants