question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incompatible peer dependencies in a workspace with Next.js and Expo projects

See original GitHub issue

Current Behavior

The latest version of @nrwl/next has a peerDependency on Next.js 12, which in turn has a peer dependency on React 17.0.2 or above. The new @nrwl/expo has a peer dependency on the latest ‘expo’, which has a peer dependency on react-native 0.64.3 which supports React 17.0.1 only. Using npm it seems impossible to have both types of projects in the same workspace without using legacy peer dependencies (which is risky and breaks stuff).

Steps to Reproduce

  • Create a new nx workspace
  • nx g @nrwl/next:app next-app
  • nx g @nrwl/expo:app expo-app
  • npm install

Failure Logs

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: boilerplate-app@0.0.0
npm ERR! Found: react@17.0.1
npm ERR! node_modules/react
npm ERR!   react@"17.0.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.2 || ^18.0.0-0" from next@12.1.2
npm ERR! node_modules/next
npm ERR!   next@"12.1.2" from the root project
npm ERR!   peer next@">=10.2.0" from eslint-config-next@12.1.5
npm ERR!   node_modules/eslint-config-next
npm ERR!     dev eslint-config-next@"^12.1.5" 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.

Environment

   Node : 14.19.1
   OS   : linux x64
   npm  : 8.1.0
   
   nx : 13.10.2
   @nrwl/angular : Not Found
   @nrwl/cypress : 13.10.2
   @nrwl/detox : 13.10.2
   @nrwl/devkit : 13.10.2
   @nrwl/eslint-plugin-nx : 13.10.2
   @nrwl/express : Not Found
   @nrwl/jest : 13.10.2
   @nrwl/js : 13.10.2
   @nrwl/linter : 13.10.2
   @nrwl/nest : Not Found
   @nrwl/next : 13.10.2
   @nrwl/node : Not Found
   @nrwl/nx-cloud : Not Found
   @nrwl/nx-plugin : Not Found
   @nrwl/react : 13.10.2
   @nrwl/react-native : Not Found
   @nrwl/schematics : Not Found
   @nrwl/storybook : 13.10.2
   @nrwl/web : 13.10.2
   @nrwl/workspace : 13.10.2
   typescript : 4.3.5
   rxjs : 6.6.7
   ---------------------------------------
   Community plugins:
   	 @nrwl/expo: 13.9.0

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
PinedaVictorcommented, Jul 18, 2022

I’m running into this issue as well. Building Nextjs web app with an Expo React native application.

  1. Created empty workspace
  2. Installed Next plugin npm install --save-dev @nrwl/next
  3. Generated Next app nx g @nrwl/next:app my-new-app
  4. Installed Expo plugin npm install -D @nrwl/expo
  5. Generated Expo app nx g @nrwl/expo:app my-expo-new-app

Both apps seem to run properly until someone else clones repo and runs npm i You get an error such as this one Screen Shot 2022-07-18 at 3 18 09 PM

1reaction
xiongemicommented, Jun 7, 2022

i think after you upgrade to latest @nrwl/expo version, it will be able to use react 18 with it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Working with monorepos - Expo Documentation
This guide will set up a simple monorepo with an Expo project. We currently have first-class support for Yarn 1 (Classic) workspaces.
Read more >
Incompatible peer dependencies found - upgrading Angular ...
Incompatible peer dependencies found. Peer dependency warnings when installing dependencies means that those dependencies might not work ...
Read more >
@nrwl/next: Versions | Openbase
Full version history for @nrwl/next including change logs. ... nextjs: remove dependency on "@nrwl/next" for the production build (#12247) (50f6cbb) ...
Read more >
npm err! code eresolve npm err! eresolve could not resolve ...
It means you have dependency conflicts. So try running the following options one by one. Remove node_modules and package-lock.json and then run. npm...
Read more >
.npmrc | pnpm
per-project configuration file ( /path/to/my/project/.npmrc ); per-workspace ... When true , all dependencies are hoisted to node_modules/.pnpm .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found