From 4068e8c7b6931e3fccf35be3d342a93d27aba64f Mon Sep 17 00:00:00 2001 From: byGalax Date: Thu, 14 May 2026 21:14:41 +0200 Subject: [PATCH] fix(mobile): hoist RN/Expo transitive deps for Metro resolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pnpm's default strict isolation hides @babel/runtime/helpers/* and other transitive deps from Metro, which expects flat node_modules layout. Each missing dep was a separate failed EAS build (metro-runtime, @babel/runtime, ...) — added .npmrc with public-hoist-pattern entries that catch the common RN/Expo families so we stop whack-a-moling them. Also kept @babel/runtime as direct dep of @chat-app/mobile for safety. --- .npmrc | 15 +++++++++++++++ apps/mobile/package.json | 1 + pnpm-lock.yaml | 3 +++ 3 files changed, 19 insertions(+) create mode 100644 .npmrc diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..39ae6c6 --- /dev/null +++ b/.npmrc @@ -0,0 +1,15 @@ +# React Native / Expo expects a flat (npm/yarn-style) node_modules layout +# where transitive deps are reachable from any package. pnpm's strict +# isolation breaks that — Metro can't resolve @babel/runtime/helpers/*, +# @expo/metro-runtime, react-native-* peers, etc. when they're only +# installed for the package that declared them. +# +# These patterns hoist the common RN/Expo dependency families to the +# workspace root node_modules so Metro and the Expo bundler can find +# them via the standard Node resolution algorithm. +public-hoist-pattern[]=*@babel/runtime* +public-hoist-pattern[]=@expo/* +public-hoist-pattern[]=expo-* +public-hoist-pattern[]=*react-native* +public-hoist-pattern[]=@react-native* +public-hoist-pattern[]=*metro* diff --git a/apps/mobile/package.json b/apps/mobile/package.json index 0afe6ae..3142e85 100644 --- a/apps/mobile/package.json +++ b/apps/mobile/package.json @@ -18,6 +18,7 @@ "clean": "rm -rf .expo node_modules/.cache .turbo *.tsbuildinfo" }, "dependencies": { + "@babel/runtime": "^7.29.2", "@chat-app/db-types": "workspace:*", "@chat-app/shared": "workspace:*", "@config-plugins/react-native-webrtc": "^10.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3e32909..5ff9623 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -150,6 +150,9 @@ importers: apps/mobile: dependencies: + '@babel/runtime': + specifier: ^7.29.2 + version: 7.29.2 '@chat-app/db-types': specifier: workspace:* version: link:../../packages/db-types