From d9f3c6c562a55cf883ba610f01e14b881a9187a4 Mon Sep 17 00:00:00 2001 From: byGalax Date: Fri, 15 May 2026 02:00:29 +0200 Subject: [PATCH] fix(mobile): enable Metro package-exports resolution for @chat-app/shared apps/mobile/lib/supabase.ts imports '@chat-app/shared/supabase'. The shared package declares this subpath in its package.json "exports" map. The dev Metro resolver respected it; the eager exporter used by preview/production builds defaulted to legacy resolution and 404'd on the subpath. unstable_enablePackageExports=true makes Metro use Node's modern exports-aware resolver in both modes. Despite the 'unstable_' prefix, it's the recommended setting in Expo SDK 52 monorepos. --- apps/mobile/metro.config.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/mobile/metro.config.js b/apps/mobile/metro.config.js index f4f52ea..cd3c3fa 100644 --- a/apps/mobile/metro.config.js +++ b/apps/mobile/metro.config.js @@ -18,5 +18,10 @@ config.resolver.nodeModulesPaths = [ path.resolve(workspaceRoot, 'node_modules'), ]; config.resolver.disableHierarchicalLookup = true; +// Make Metro honor the "exports" field in package.json. @chat-app/shared +// maps subpaths like "./supabase" -> "./src/supabase/index.ts" via exports; +// without this flag the eager bundler (preview/production) ignores them +// and falls back to legacy main-only resolution, which 404s on subpaths. +config.resolver.unstable_enablePackageExports = true; module.exports = config;