nandorojo / solito

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

Starter monorepo deployment fails #48

Closed fobos531 closed 2 years ago

fobos531 commented 2 years ago

Hello,

I've tried to use deploy the starter monorepo but I'm getting this error on compile:

CleanShot 2022-04-14 at 12 48 08@2x

I also tried to manually create a solito app locally, and I'm getting the same kind of error: CleanShot 2022-04-14 at 12 48 50

Do you have any ideas as to what might be the issue?

nandorojo commented 2 years ago

that’s odd. this happens on a fresh repo? or did you upgrade to react 18?

fobos531 commented 2 years ago

that’s odd. this happens on a fresh repo? or did you upgrade to react 18?

On a fresh repo, when I press the vercel deploy button. When using create-solito-app, it happens after the command has finished executing. I have not upgraded to React 18.

If there's any debugging info I can provide to help alleviate this, please let me know.

nandorojo commented 2 years ago

i removed the lock file yesterday so that might be why.

nandorojo commented 2 years ago

can you do yarn why @types/react-native

fobos531 commented 2 years ago

yarn why @types/react-native


[1/4] 🤔  Why do we have the module "@types/react-native"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "@types/react-native@0.67.4"
info Has been hoisted to "@types/react-native"
info Reasons this module exists
   - "workspace-aggregator-59eea0f8-6596-49ee-a5e5-0eafbe4be990" depends on it
   - Specified in "devDependencies"
   - Hoisted from "_project_#@types#react-native"
info Disk size without dependencies: "600KB"
info Disk size with unique dependencies: "784KB"
info Disk size with transitive dependencies: "1.96MB"
info Number of shared dependencies: 4
=> Found "expo-app#@types/react-native@0.64.24"
info This module exists because "_project_#expo-app" depends on it.
info Disk size without dependencies: "604KB"
info Disk size with unique dependencies: "788KB"
info Disk size with transitive dependencies: "1.96MB"
info Number of shared dependencies: 4
✨  Done in 0.61s.```
nandorojo commented 2 years ago

I’ll revert the yarn lock changes later today if I have some time. You can copy it from the commits if you’d like.

fobos531 commented 2 years ago

Yep, that seems to have done the trick. Thank you very much!

nandorojo commented 2 years ago

I believe I just pushed the fix!

wibb36 commented 2 years ago

If one happens to upgrade to react 18, you'll most likely run into this issue since react native is depending on the latest @types/react and you end up with two different versions in your monorepo. To be safe, in the root package.json, add "resolutions": { "@types/react": "version you're using in apps/expo" }.

To check run: yarn why @types/react or check your yarn.lock file.