next-safe icon indicating copy to clipboard operation
next-safe copied to clipboard

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

Open april-ctrlspire opened this issue 3 years ago • 4 comments

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: [email protected]
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 [email protected]
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

  • [X] I agree to follow this project's Code of Conduct

april-ctrlspire avatar Feb 10 '22 04:02 april-ctrlspire

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.

frattaro avatar Jun 08 '22 14:06 frattaro

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"
  },

kiily avatar Jul 27 '22 14:07 kiily

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

sladg avatar Aug 01 '22 08:08 sladg

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 :)

kiily avatar Aug 12 '22 16:08 kiily

Fixed by #45

trezy avatar Dec 05 '22 17:12 trezy

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

Cirelion avatar Dec 31 '22 02:12 Cirelion

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

kiily avatar Jan 03 '23 21:01 kiily