nandorojo / solito

🧍‍♂️ React Native + Next.js, unified.
https://solito.dev
MIT License
3.53k stars 179 forks source link

Can't resolve react-native #103

Closed KaniDev closed 2 years ago

KaniDev commented 2 years ago

Hello ! I am trying to implement Solito in a Next + React Native monorepo (no Expo)

I built the repo myself since the solito starter was using Expo; everything works seemingly fine. However, after adding Solito and its config as the website says, I have an error at runtime when starting Next: error - ../../node_modules/@react-navigation/native/lib/module/Link.js:2:0 Module not found: Can't resolve 'react-native'

The file exists and isn't empty.

Import trace:

../../node_modules/@react-navigation/native/lib/module/index.js
../../node_modules/solito/build/router/use-link-to.js
../../node_modules/solito/build/link/core.js
../../node_modules/solito/build/link/index.js
../../node_modules/solito/link/index.js
../shared/homepage.tsx
./pages/index.tsx

next.config.txt

nandorojo commented 2 years ago

It's hard to help here. Monorepos are very complicated and there are many things that could be wrong with how you set it up. I recommend using the starter monorepo, and just uninstall expo from apps/expo (and you can rename that folder too).

npx create-solito-app@latest my-solito-app
cd my-solito-app/apps/expo
yarn remove expo