Closed acomito closed 2 years ago
possibly related to https://github.com/expo/expo/issues/15600 ?
Okay an update... I was able to get this working without an error
BUT
If i put the expo project inside of another project (as a monorepo), I get the error again. Consistently. I put it in that folder, I get it. I take it out, it's gone.
Really strange... any reason expo couldn't be in a monorepo? How would expo know it's sitting in a monorepo vs any other folder on my file system
Yeah I'm also having problems with re-animated since upgrading to v44 of the Expo SDK.
This is the issue I'm seeing:
Not entirely sure what I'm missing....
Mine was very strange... it worked outside of our monorepo but not inside the monorepo. I could slide the project out of the monorepo, it worked. Slide the expo project folder back into the monorepo and run it... didn't work.
No idea how expo even knows what folder it is living in but I'm keeping it separate for now.
Monorepo issues are probably related to how your node_modules are hoisted. In a monorepo they tend to get pulled up into the root of the project but react native will be looking for many of its dependencies at the workspace/project level. Metro config is where to go to implement a fix for that I believe.
That said, its just one possible problem. I'm dealing with issues related to reanimated and upgrading to 43/44 myself and don't have answers beyond this suggestion.
I'm having a similar problem with react-native-reanimated via @react-navigation/drawer failing inside a monorepo.
@acomito have you followed the docs on setting up Expo inside a monorepo workspace https://docs.expo.dev/guides/monorepos/ (which includes metro config for checking both root and workspace dependencies)? And is your babel config including the reanimated plugin in the expo app workspace root, or in the monorepo root?
I've been getting something slightly different; I get the same "maybe you forgot to add Reanimated's babel plugin?" if the babel config is not in the workspace directory, but if it is, the whole build fails silently: expo logs hang at "Starting Metro Bundler" and the apps crash with generic "Something went wrong" messages and nothing in device logs (happens for me with reanimated v2.x and v1.x).
[edit]: my "failing silently" seems to be the "LAN" console swallowing the following opaque error, which is shown if I switch Expo UI to "Tunnel":
Error: EISDIR: illegal operation on a directory, read
at Object.readSync (node:fs:721:3)
at tryReadSync (node:fs:431:20)
at Object.readFileSync (node:fs:477:19)
at UnableToResolveError.buildCodeFrameMessage (/...repo-root/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:347:17)
at new UnableToResolveError (/...repo-root/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:333:35)
at ModuleResolver.resolveDependency (/...repo-root/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:211:15)
at DependencyGraph.resolveDependency (/...repo-root/node_modules/metro/src/node-haste/DependencyGraph.js:413:43)
at /...repo-root/node_modules/metro/src/lib/transformHelpers.js:317:42
at /...repo-root/node_modules/metro/src/Server.js:1471:14
at Generator.next (<anonymous>)
My best guess is that it's something to do with Expo's recommended babel config's api.cache
setting somehow not being compatible with monorepos? Though I get the same with it set to true
or false
(and an error that its unconfigured if I omit the api.cache
line).
I have similar issues. Is there a resolution out there for this? We're dead in the water on our 44 upgrade because of this.
@acomito Could you share how you go it to work without an error?
Hi all, my only solution was to move expo outside of the monorepo. We didn't want to invest too much time figuring it out and it works fine outside of the monorepo.
having the same issue after upgrading to 44, in a project that expo is the root project (not having monorepo or any equivalent) :/
This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.
This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.
Summary
Managed or bare workflow? If you have
ios/
orandroid/
directories in your project, the answer is bare!managed
What platform(s) does this occur on?
iOS
SDK Version (managed workflow only)
~44.0.0
Environment
Reproducible demo
https://github.com/acomito/expo-bug-44