#nextjs issue

28 messages · Page 1 of 1 (latest)

spiral lagoon
#

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@latest
npm 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.

scenic pagodaBOT
#

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](https://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!
craggy sorrel
#

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:

{
  "overrides": {
    "react": "^19.0.0-rc-66855b96-20241106"
  }
}
#

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)

spiral lagoon
#

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...

craggy sorrel
#

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 good

spiral lagoon
#

I 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?

craggy sorrel
#

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

spiral lagoon
#

Okay thats wierd, because i copy cat the commands from the convex guide, maybe im wrong 🙂

twin adder
#

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)

spiral lagoon
#

npx create-next-app@latest my-app

#

thats the command that gave me react 19 🙂

twin adder
#

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)

spiral lagoon
#

I created the issue, trying to explain to @craggy sorrel the problem with the guide.

twin adder
#

The change needed may be

- "react": "^17.0.2 || ^18.0.0",
+ "react": "^17.0.2 || ^18.0.0 || ^19.0.0-0" 
spiral lagoon
#

exaclty

twin adder
#

but there could be some work to do to actually make it compatible

spiral lagoon
#

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

twin adder
#

that's not our command, we'd need to write our own create-next-app thing

spiral lagoon
twin adder
#

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