trezy / next-safe

https://trezy.gitbook.io/next-safe/
BSD 3-Clause "New" or "Revised" License
167 stars 20 forks source link

[BUG]: Could not install next-safe when nextjs version is 12. #39

Closed april-ctrlspire closed 1 year ago

april-ctrlspire commented 2 years ago

Describe the bug

I just installed the latest nextjs (12.0.10) and trying to install next-safe and got error that it could not resolve dependency. Is the latest next-safe not compatible with the latest nextjs?

% npm i next-safe
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: me-mini-sites@undefined
npm ERR! Found: next@12.0.10
npm ERR! node_modules/next
npm ERR!   next@"^12.0.10" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer next@"^9.5.0 || ^10.2.1 || ^11.1.0" from next-safe@3.2.1
npm ERR! node_modules/next-safe
npm ERR!   next-safe@"*" 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! See /Users/eptalampas/.npm/eresolve-report.txt for a full report.

Version

v3.x.x

Code of Conduct

frattaro commented 2 years ago

Github actions started hiccupping on this for me. Possibly because I recently started running against node 16 (since AWS lambdas now support node 16). Succeeds on rerun.

kiily commented 1 year ago

I can confirm that this is happening for me too on Next.js 12, Node.js 16. Happy to put a PR in to add Next.js 12 as a peer dependency in package.json. Any doc I can have a look at for how to test, don't think there is anything on the new version that would cause the library to break.

"peerDependencies": {
    https://github.com/vercel/next.js: "^9.5.0 || ^10.2.1 || ^11.1.0"
  },
sladg commented 1 year ago

Hey! can we include Next12 as dependency? Failing build on Node16 in past days (no changes to versions, just started failing).

kiily commented 1 year ago

Added the PR as per the mention above - https://github.com/trezy/next-safe/pull/45. We won't be revisiting this on our side but hopefully helps those that need it right now :)

trezy commented 1 year ago

Fixed by #45

Cirelion commented 1 year ago

I have this exact same problem but with Next 13.1.1. Should I open a new issue for this?

kiily commented 1 year ago

I know this has been closed but put the PR referenced above to address the issue @Cirelion 👍 Should work once it gets merged :)