byCedric / expo-monorepo-example

Fast pnpm monorepo for cross-platform apps built with Expo / React Native and React.
https://docs.expo.dev/guides/monorepos/
MIT License
724 stars 76 forks source link

Unable to find certain map files #56

Open robbertrosario opened 2 years ago

robbertrosario commented 2 years ago

I have a repo with around 7 apps and bunch of packages but sometimes the EAS actions (or a simple expo install within an app directory) fail with the commands being unable to find a .map file.

Error: ENOENT: no such file or directory, open /Users/something/app/packages/utils/build/module/formatDateDefault.js.map

It is kinda of weird because I can see the file being there on my filesystem. When the actions fail with the same issue, I can usually resolve it by simply running that action again and then it works.

Does anyone else experience this?

byCedric commented 2 years ago

Do you run the build command that generates these map files, in EAS or only locally?

robbertrosario commented 2 years ago

I am building the app thru the workflow actions which I haven't changed and are the same as seen in this repo. Should I build in EAS before starting the workflow actions?

byCedric commented 2 years ago

One thing you can try is also building the packages inside EAS. With that, you should be confident all build output is available when building the app.

You can add a Build lifecycle hook, specifically the eas-build-post-install script. If you add something like this to your app's package.json, it should build the repository before building your app.

"scripts": {
  "eas-build-post-install": "yarn workspaces run build"
}

Assuming you still use the yarn version of this repository. See this file for example.