From 6615b23c8b6ded49ca46c4745dff4d9dc54aa898 Mon Sep 17 00:00:00 2001 From: Mohamed Boudra Date: Tue, 2 Dec 2025 11:25:18 +0000 Subject: [PATCH] fix: apply import.meta transform to ALL platforms (web + native) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The previous fix only applied unstable_transformImportMeta to the native platform, but Zustand 5's import.meta.env usage also breaks on web. Moving the transform to the top level ensures it applies to both web and native platforms, fixing the "Cannot use 'import.meta' outside a module" error across all platforms. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- packages/app/babel.config.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/app/babel.config.js b/packages/app/babel.config.js index ed101b402..33e395b88 100644 --- a/packages/app/babel.config.js +++ b/packages/app/babel.config.js @@ -1,7 +1,17 @@ module.exports = function (api) { api.cache(true); + + const expoPreset = [ + "babel-preset-expo", + { + // Transform `import.meta` for ALL platforms (web + native) + // Required for modern ESM deps like Zustand 5 that use import.meta.env + unstable_transformImportMeta: true, + }, + ]; + return { - presets: ["babel-preset-expo"], + presets: [expoPreset], plugins: [ [ "react-native-unistyles/plugin",