You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the improvement or update you wish to see?
Link to documentation
There is a small error in this documentation, In jest.config.mjs file the import needs to include .js extension like this import nextJest from 'next/jest.js' otherwise it shows this error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'C:\Users\uzair\Downloads\next-test\node_modules\next\jest' imported from C:\Users\uzair\Downloads\next-test\jest.config.mjs
Did you mean to import next-test/node_modules/next/jest.js?
at new NodeError (node:internal/errors:399:5)
at finalizeResolution (node:internal/modules/esm/resolve:326:11)
at moduleResolve (node:internal/modules/esm/resolve:945:10)
at defaultResolve (node:internal/modules/esm/resolve:1153:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
at link (node:internal/modules/esm/module_job:76:36)
I created the pull request to fix this issue #54107
Here's the fresh nextjs install with default options repo, in which I've only installed jest by following the documentation npm install --save-dev jest jest-environment-jsdom @testing-library/react @testing-library/jest-dom and it's also showing this error.
Is there any context that might help us understand?
I created the pull request to add .js extension while importing jest library which resolves this issue.
Does the docs page already exist? Please link to it.
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.
What is the improvement or update you wish to see?
Link to documentation
There is a small error in this documentation, In
jest.config.mjs
file the import needs to include.js
extension like thisimport nextJest from 'next/jest.js'
otherwise it shows this errorI created the pull request to fix this issue #54107
Here's the fresh
nextjs
install with default options repo, in which I've only installed jest by following the documentationnpm install --save-dev jest jest-environment-jsdom @testing-library/react @testing-library/jest-dom
and it's also showing this error.Is there any context that might help us understand?
I created the pull request to add
.js
extension while importing jest library which resolves this issue.Does the docs page already exist? Please link to it.
https://nextjs.org/docs/pages/building-your-application/optimizing/testing#jest-and-react-testing-library
The text was updated successfully, but these errors were encountered: