next-learn: npm ERR! Could not resolve dependency: npm ERR! peer react@"19.0.0-rc.0" from next@15.0.0-canary.56
I’m on chapter 10. Although my project still works locally, I started getting this error in the build logs in vercel:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: undefined@undefined
npm ERR! Found: react@19.0.0-rc-f38c22b244-20240704
npm ERR! node_modules/react
npm ERR! react@"19.0.0-rc-f38c22b244-20240704" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"19.0.0-rc.0" from next@15.0.0-canary.56
npm ERR! node_modules/next
npm ERR! next@"15.0.0-canary.56" 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-07-12T11_41_02_681Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /vercel/.npm/_logs/2024-07-12T11_41_02_681Z-debug-0.log
Error: Command "npm install" exited with 1
I can’t seem to get past this. Any suggestions?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 18 (4 by maintainers)
Here is how you can get a running project @scottfennell-toptal :
This is the project which serves as the baseline for the Dashboard tutorial. And as a tutorial, its primary target is people which may not be expert at React and Next because they came here…to learn.
So why targeting RC versions of depencies which may be subject to change and to make this project unusable for the intended audience?
@scottfennell-toptal react and other problematic dependencies should be updated to more stable versions.
Just adding to this - was following the tutorial as I haven’t touched Next for a while.
When adding
"use client";to the top ofnav-links.tsxI got the errorUnsupported Server Component type: undefined.This was fixed by:
$ pnpm remove next$ pnpm add next@latestTo echo what @romu70 said, you shouldn’t expect these kind of issues in an official starter tutorial.
Edit:
The next issue is the Vercel build error
Type error: Cannot find module '@/app/ui/fonts' or its corresponding type declarations.- the file exists and there are no issues locally.I don’t think I will be continuing with Next - if there are these issues not even halfway through the simple official starter tutorial, what will the issues be like for a full-blown production project?
You can use steps shared by @romu70 (direct link: https://github.com/vercel/next-learn/issues/802#issuecomment-2225807041) It worked for me.