moshest / next-client-cookies

SSR and client support for cookies in Next.js 13 (app directory)
MIT License
149 stars 9 forks source link

Cannot be used with Next.js canary releases #15

Closed mordechaim closed 10 months ago

mordechaim commented 10 months ago

There's a dependency resolution error when trying to use this library with Next.js canary:

npm ERR! code ERESOLVE
--
22:37:29.375 | npm ERR! ERESOLVE could not resolve
22:37:29.375 | npm ERR!
22:37:29.376 | npm ERR! While resolving: next-client-cookies@1.1.0
22:37:29.376 | npm ERR! Found: next@14.1.1-canary.0
22:37:29.376 | npm ERR! node_modules/next
22:37:29.376 | npm ERR!   next@"^14.1.1-canary.0" from the root project
22:37:29.376 | npm ERR!
22:37:29.376 | npm ERR! Could not resolve dependency:
22:37:29.376 | npm ERR! peer next@">= 13.0.0" from next-client-cookies@1.1.0
22:37:29.376 | npm ERR! node_modules/next-client-cookies
22:37:29.376 | npm ERR!   next-client-cookies@"^1.1.0" from the root project
22:37:29.376 | npm ERR!
22:37:29.376 | npm ERR! Conflicting peer dependency: next@14.1.0
22:37:29.377 | npm ERR! node_modules/next
22:37:29.377 | npm ERR!   peer next@">= 13.0.0" from next-client-cookies@1.1.0
22:37:29.377 | npm ERR!   node_modules/next-client-cookies
22:37:29.377 | npm ERR!     next-client-cookies@"^1.1.0" from the root project
22:37:29.377 | npm ERR!
22:37:29.377 | npm ERR! Fix the upstream dependency conflict, or retry
22:37:29.377 | npm ERR! this command with --force or --legacy-peer-deps
22:37:29.377 | npm ERR! to accept an incorrect (and potentially broken) dependency resolution.

I currently use --legacy-peer-deps, but this only works locally, not when deploying to Vercel (where I can't set this flag)

mordechaim commented 10 months ago

I figured you could provide --legacy-peer-deps flag to Vercel, in the build settings; by overriding the default Build command

moshest commented 10 months ago

Can you suggest what's the peerDependency value should be?

mordechaim commented 10 months ago

Seems like nothing 🤦‍♀️, didn't know that semver doesn't match prereleases.

moshest commented 10 months ago

That's what I remembered. Thanks for verifying.

I'm closing this for now as there is nothing else we can do here.