nextjs issue
After starting a new fresh project using nextjs, i tried to install convex-helpers, it throws this error when installing convex-helpers,.
npm install convex-helpers@latestnpm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: nextjs-example-token@0.1.0 npm ERR! Found: react@19.0.0-rc-66855b96-20241106 npm ERR! node_modules/react npm ERR! react@"19.0.0-rc-66855b96-20241106" from the root project npm ERR! peerOptional react@"^17.0.2 ^18.0.0 ^19.0.0-0" from convex@1.17.3 npm ERR! node_modules/convex npm ERR! convex@"^1.17.3" from the root project npm ERR! peer convex@"^1.13.0" from convex-helpers@0.1.65 npm ERR! node_modules/convex-helpers npm ERR! convex-helpers@"0.1.65" from the root project npm ERR! 2 more (react-dom, @clerk/clerk-react) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peerOptional react@"^17.0.2 || ^18.0.0" from convex-helpers@0.1.65 npm ERR! node_modules/convex-helpers npm ERR! convex-helpers@"0.1.65" 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.
20 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
nextjs-example-token
requires a react 19 release candidate, you could try overriding to use the release candidate for everything, but not sure how that will go:
Or maybe find an alternative to nextjs-example-token - it's not on the registry so I'm not sure what it is (probably a dep of nextjs)nextjs-example-token is my project i just created ... convex-helpers requires react 17 or 18,,,but using convex guide the nextjs comes with react latest version...
Latest next accepts react v18 though, specifically:
"react": "^18.2.0 || 19.0.0-rc-66855b96-20241106",
If you update peer dependencies on your token project to match that you should be goodI understand you can do that, but imagine a new user following the guide and get this error, and he needs to add this overrides to package json file?
No, you don't need to override. Your only problem is that you created a package that requires React v19. Next doesn't require that, and neither does convex-helpers.
Update the react peer dependency in your nextjs-example-token package to be compatible and you'll be good, as far as I can tell
Okay thats wierd, because i copy cat the commands from the convex guide, maybe im wrong 🙂
We may continue not to support React 19 until it's stable, but it's frustrating for people trying to use Next.js 15 (which with the app router I believe does require React 19)
npx create-next-app@latest my-app
thats the command that gave me react 19 🙂
yeah convex now supports React 19, but convex-helpers doesn't yet
(well "supports" as in supports the prerelease, React 19 has not come out yet)
@jamalsoueidan could you open an issue at https://github.com/get-convex/convex-helpers/issues
I created the issue, trying to explain to @erquhart the problem with the guide.
The change needed may be
exaclty
but there could be some work to do to actually make it compatible
which guide?
well the guide command is still giving us react 19, so maybe update the command to specify some specific version
npx create-next-app@latest my-app
that's not our command, we'd need to write our own create-next-app thing
Next.js Quickstart | Convex Developer Hub
Add Convex to a Next.js project
but yeah I think the confusion is that Next.js 15 doesn't "technically" require React 19 prerelease, because you can use React 18 with the pages router, but that command often sets you up with the app router which does
I think we've identified the issue, that guide works correctly, but convex-helpers does not work with it
thank you