Closed caioalmeida12 closed 6 days ago
I got the same error after migrating from NextJS 13 to NextJS 14 and when running lighthouse. But I cannot replicate locally
Hello, I faced the same error, and I just solved as follows:
First, open a cmd in your sisref-v2-dashboard folder, and type :
Then, in sisref-v2-dashboard/package.json, add your dependencies “next”, “react” & “react-dom” to exactly the same version as those in sisref-v2-dashboard/sisref-v2-dashboard-client/package.json, so your sisref-v2-dashboard/package.json sould look like :
{
"dependencies": {
"@microsoft/eslint-formatter-sarif": "2.1.7",
"@radix-ui/react-form": "^0.0.3",
"@radix-ui/react-icons": "^1.3.0",
"@radix-ui/react-navigation-menu": "^1.1.4",
"@radix-ui/react-tooltip": "^1.0.7",
"@types/jsonwebtoken": "^9.0.6",
"eslint": "8.57.0",
"jsonwebtoken": "^9.0.2",
"next": "14.1.4",
"react": "^18",
"react-dom": "^18",
"react-loading-skeleton": "^3.4.0",
"slide-element": "^2.3.1",
"typescript": "^5.0.0"
},
"name": "sisref-v2-dashboard",
"module": "index.ts",
"type": "module",
"devDependencies": {
"@commitlint/cli": "^19.2.1",
"@commitlint/config-conventional": "^19.1.0",
"@eslint/js": "^8.57.0",
"@types/bun": "latest",
"cz-conventional-changelog": "^3.3.0",
"eslint-plugin-react": "^7.34.1",
"globals": "^15.0.0",
"husky": "^9.0.11",
"typescript-eslint": "^7.7.0"
},
"peerDependencies": {
"typescript": "^5.0.0"
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
"scripts": {
"cm": "cz",
"dev": "cd sisref-v2-dashboard-client; bun dev",
"lint": "bun eslint ./sisref-v2-dashboard-client/src/ --fix",
"lint-ci": "npx eslint ./sisref-v2-dashboard-client/src/ --format @microsoft/eslint-formatter-sarif > eslint-results.sarif"
}
}
Finally, you just need to npm install
, you are good to go !
Hello, I faced the same error, and I just solved as follows:
First, open a cmd in your sisref-v2-dashboard folder, and type :
- npm uninstall next
- npm uninstall react
- npm uninstall react-dom
Then, in sisref-v2-dashboard/package.json, add your dependencies “next”, “react” & “react-dom” to exactly the same version as those in sisref-v2-dashboard/sisref-v2-dashboard-client/package.json, so your sisref-v2-dashboard/package.json sould look like :
{ "dependencies": { "@microsoft/eslint-formatter-sarif": "2.1.7", "@radix-ui/react-form": "^0.0.3", "@radix-ui/react-icons": "^1.3.0", "@radix-ui/react-navigation-menu": "^1.1.4", "@radix-ui/react-tooltip": "^1.0.7", "@types/jsonwebtoken": "^9.0.6", "eslint": "8.57.0", "jsonwebtoken": "^9.0.2", "next": "14.1.4", "react": "^18", "react-dom": "^18", "react-loading-skeleton": "^3.4.0", "slide-element": "^2.3.1", "typescript": "^5.0.0" }, "name": "sisref-v2-dashboard", "module": "index.ts", "type": "module", "devDependencies": { "@commitlint/cli": "^19.2.1", "@commitlint/config-conventional": "^19.1.0", "@eslint/js": "^8.57.0", "@types/bun": "latest", "cz-conventional-changelog": "^3.3.0", "eslint-plugin-react": "^7.34.1", "globals": "^15.0.0", "husky": "^9.0.11", "typescript-eslint": "^7.7.0" }, "peerDependencies": { "typescript": "^5.0.0" }, "config": { "commitizen": { "path": "./node_modules/cz-conventional-changelog" } }, "scripts": { "cm": "cz", "dev": "cd sisref-v2-dashboard-client; bun dev", "lint": "bun eslint ./sisref-v2-dashboard-client/src/ --fix", "lint-ci": "npx eslint ./sisref-v2-dashboard-client/src/ --format @microsoft/eslint-formatter-sarif > eslint-results.sarif" } }
Finally, you just need to
npm install
, you are good to go !
Just came here to say THANK YOU VERY MUCH!
Not only did this solve this issue's error, but also fixed another ghostly unsolved one: this dude right here - error: Failed due to error: bunsh: No such file or directory running bun dev
Can't believe it was that simple of a fix.
But its as they say: victory is in the simple things.
Just as i reminder, thank you @Ashka59!
Link to the code that reproduces this issue
https://github.com/caioalmeida12/sisref-v2-dashboard/tree/110-instalar-docker
To Reproduce
Current vs. Expected behavior
Currently, instead of being able to access the page, it crashes upon request to the / route. It compiles the middlewares perfectly, tho.
Provide environment information
Which area(s) are affected? (Select all that apply)
Module Resolution, Navigation, Runtime
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
I tested running on Node 20.13 LTS, but didnt work as well. I cant figure out why my NPM base command wont work, tho. I've been falling back to bun, which works perfectly. Might be related.