-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot resolve peer dependency 'react' (or 'react-native) #43
Comments
Hey @zanerichard I was running —more or less— with the same issue as you react-native-universal-monorepo git:master*
❯ yarn next:start
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
warn - You have enabled experimental feature(s).
warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use them at your own risk.
info - Using external babel configuration from /Users/cerebra/workspace/react-native-universal-monorepo/packages/next/babel.config.js
Browserslist: caniuse-lite is outdated. Please run:
npx browserslist@latest --update-db
Why you should do it regularly:
https://github.com/browserslist/browserslist#browsers-data-updating
error - ../../node_modules/@next/react-dev-overlay/lib/internal/ErrorBoundary.js:22:0
Module not found: Can't resolve 'react'
Solution
nodeLinker: node-modules
nmHoistingLimits: workspaces
Now it's working 👏 for the web app ❯ yarn next:start
yarn run v1.23.0-20220130.1630
$ yarn workspace @my-app/next dev
$ next dev
ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
warn - You have enabled experimental feature(s).
warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use them at your own risk.
info - Using external babel configuration from /Users/cerebra/workspace/react-native-universal-monorepo/packages/next/babel.config.js
event - compiled successfully Maybe your issue is related to your |
🤔 In fact I double-checked this morning and it's not working with yarn berry here is the version that I use ❯ yarn --version
1.23.0-20220130.1630 |
Did you manage to fix this? |
@ovidiu-balau If you have issues with |
I've just faced the same issue with |
Hi all,
After cloning the repo and installing with
yarn
I tried to simply launch the Android app usingyarn android:start
.However, the app launches with an error (see below).
My assumption is that this has to do with the nature of peer dependencies in the app package.
If I remove the react import from
.../packages/app/src/App.tsx
the same error occurs withreact-native
.Somehow, the bundler does not use the react/react-native packages provided in the
node_modules
of themobile
package.Did I forget to do something or is this a bug?
I am using yarn 1.22.18
The text was updated successfully, but these errors were encountered: