Vercel builds failing after upgrading to next 14.2.3
Unanswered
Thai Ridgeback posted this in #help-forum
Thai RidgebackOP
Hi!
I have updated my project's nextjs version to 14.2.3, and updated the node version to 20.x on Vercel, due to Vercel dropping support of node 14.x which this project used to run on.
The project builds and runs perfectly well locally, but I get the following error on Vercel when attempting to build it:
Here is my package.json (this is an open source project):
https://github.com/Trekiros/questcheck/blob/main/package.json
Any idea how to fix this? Thank you
I have updated my project's nextjs version to 14.2.3, and updated the node version to 20.x on Vercel, due to Vercel dropping support of node 14.x which this project used to run on.
The project builds and runs perfectly well locally, but I get the following error on Vercel when attempting to build it:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: next-axiom@0.17.0
npm ERR! Found: next@14.2.3
npm ERR! node_modules/next
npm ERR! next@"^14.2.3" from the root project
npm ERR! peer next@">=10" from @clerk/nextjs@4.29.8
npm ERR! node_modules/@clerk/nextjs
npm ERR! @clerk/nextjs@"^4.29.3" from the root project
npm ERR! 4 more (@trpc/next, @vercel/analytics, @vercel/speed-insights, next-seo)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer next@"^12.1.4 || ^13" from next-axiom@0.17.0
npm ERR! node_modules/next-axiom
npm ERR! next-axiom@"^0.17.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: next@13.5.6
npm ERR! node_modules/next
npm ERR! peer next@"^12.1.4 || ^13" from next-axiom@0.17.0
npm ERR! node_modules/next-axiom
npm ERR! next-axiom@"^0.17.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /vercel/.npm/_logs/2024-05-23T17_05_15_876Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /vercel/.npm/_logs/2024-05-23T17_05_15_876Z-debug-0.log
Error: Command "npm install" exited with 1Here is my package.json (this is an open source project):
https://github.com/Trekiros/questcheck/blob/main/package.json
Any idea how to fix this? Thank you
21 Replies
Thai RidgebackOP
Here's the package.json file laid out so it can get indexed in Discord's search, in case someone else has the same issue:
{
"name": "questcheck",
"type": "module",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
},
"dependencies": {
"@clerk/nextjs": "^4.29.3",
"@clerk/themes": "^1.7.9",
"@fortawesome/fontawesome-svg-core": "^6.2.0",
"@fortawesome/free-brands-svg-icons": "^6.5.1",
"@fortawesome/free-solid-svg-icons": "^6.2.0",
"@fortawesome/react-fontawesome": "^0.2.0",
"@react-pdf/renderer": "^3.3.8",
"@tanstack/react-query": "^4.36.1",
"@trpc/client": "^10.45.0",
"@trpc/next": "^10.45.0",
"@trpc/react-query": "^10.45.0",
"@trpc/server": "^10.45.0",
"@vercel/analytics": "^1.1.1",
"@vercel/og": "^0.6.2",
"@vercel/speed-insights": "^1.0.2",
"eslint": "8.42.0",
"eslint-config-next": "13.4.4",
"mongodb": "^6.3.0",
"next": "^14.2.3",
"next-axiom": "^0.17.0",
"next-seo": "^6.5.0",
"raw-loader": "^4.0.2",
"react": "18.2.0",
"react-beautiful-dnd": "^13.1.1",
"react-datepicker": "^6.2.0",
"react-dom": "18.2.0",
"react-markdown": "^8.0.7",
"react-select": "^5.8.0",
"rehype-raw": "^7.0.0",
"remark-gfm": "^3.0.1",
"sonner": "^1.4.1",
"superjson": "^2.2.1",
"typescript": "5.1.3",
"zod": "^3.21.4"
},
"devDependencies": {
"@types/node": "20.2.6",
"@types/react": "18.2.25",
"@types/react-beautiful-dnd": "^13.1.8",
"@types/react-datepicker": "^6.0.2",
"@types/react-dom": "18.2.4",
"sass": "^1.71.1"
}
}@Thai Ridgeback Hi!
I have updated my project's nextjs version to 14.2.3, and updated the node version to 20.x on Vercel, due to Vercel dropping support of node 14.x which this project used to run on.
The project builds and runs perfectly well locally, but I get the following error on Vercel when attempting to build it:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: next-axiom@0.17.0
npm ERR! Found: next@14.2.3
npm ERR! node_modules/next
npm ERR! next@"^14.2.3" from the root project
npm ERR! peer next@">=10" from @clerk/nextjs@4.29.8
npm ERR! node_modules/@clerk/nextjs
npm ERR! @clerk/nextjs@"^4.29.3" from the root project
npm ERR! 4 more (@trpc/next, @vercel/analytics, @vercel/speed-insights, next-seo)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer next@"^12.1.4 || ^13" from next-axiom@0.17.0
npm ERR! node_modules/next-axiom
npm ERR! next-axiom@"^0.17.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: next@13.5.6
npm ERR! node_modules/next
npm ERR! peer next@"^12.1.4 || ^13" from next-axiom@0.17.0
npm ERR! node_modules/next-axiom
npm ERR! next-axiom@"^0.17.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /vercel/.npm/_logs/2024-05-23T17_05_15_876Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /vercel/.npm/_logs/2024-05-23T17_05_15_876Z-debug-0.log
Error: Command "npm install" exited with 1
Here is my package.json (this is an open source project):
https://github.com/Trekiros/questcheck/blob/main/package.json
Any idea how to fix this? Thank you
Hey, it appears that one of your dependencies, specifically next-axiom, expects a older version of next, however once you upgraded to next 14, it creates a conflict between those dependencies. I'd recommend switching to another dependency for next-axiom, upgrading to it's latest version which may solve the conflict. It's not recommended to use --force since next 14 has introduced breaking changes which may break next-axiom.
@Dax Hey, it appears that one of your dependencies, specifically next-axiom, expects a older version of next, however once you upgraded to next 14, it creates a conflict between those dependencies. I'd recommend switching to another dependency for next-axiom, upgrading to it's latest version which may solve the conflict. It's not recommended to use --force since next 14 has introduced breaking changes which may break next-axiom.
Blue Picardy Spaniel
this is an old post, it bumped to the top as i sent a message
@Blue Picardy Spaniel how did you resolve this? im getting the same issue when upgrading to next 15
Same here, next 15 uses react 19 while all dependencies afn use react 18. That's why i don't recommend switching to next 15 until react 19 is widely supported.
Blue Picardy Spaniel
ah
how do i downgrade again?
@Blue Picardy Spaniel how do i downgrade again?
That i don't know, you may have to #gpt-help or #help-forum . I'm new to coding myself.
Blue Picardy Spaniel
alr
--legacy-peer-depsYou can try ⬆️ @Thai Ridgeback
I personally won't recommend doing that.
@Dax Same here, next 15 uses react 19 while all dependencies afn use react 18. That's why i don't recommend switching to next 15 until react 19 is widely supported.
^ This is the conundrum with the upgrade for sure.
mhm!
And while yes, most dependencies even if they aren't pointing to React 19, will probably work, it's absolutely not worth the risk in a production application at the moment.
I am looking forward to upgrading to Next 15, and will use it for personal projects. But at our company, it will have to wait hahaa
Hmm, I'm not sure, there are a few breaking changes in React 19, and it's not stable yet.
@Dax Hmm, I'm not sure, there are a few breaking changes in React 19, and it's not stable yet.
Yeah, I've forced it on some fairly extensive hobby projects and some packages were super finnicky...
but others were just fine, I think that highlights the issue, it's a shot in the dark
lol
lolnice