moshest / next-client-cookies

SSR and client support for cookies in Next.js 13 (app directory)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot be used with Next.js canary releases

mordechaim opened this issue · comments

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)

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

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

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

That's what I remembered. Thanks for verifying.

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