From 81f7ce09b1474945fa27f37d366ad9382b3c9ec6 Mon Sep 17 00:00:00 2001 From: "marta.sudol" Date: Wed, 20 Aug 2025 08:46:02 +0200 Subject: [PATCH 1/5] fix: The global process.env.EXPO_OS is not defined. This should be inlined by babel-preset-expo during transformation. --- metro.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/metro.config.js b/metro.config.js index 90ae8c6becea..c5a321dd38bc 100644 --- a/metro.config.js +++ b/metro.config.js @@ -33,6 +33,7 @@ const config = { inlineRequires: true, }, }), + platforms: ['ios', 'android', 'native', 'web'], }, }; From 9210082431db48d3c5fbdc4a5b9e75875e845b82 Mon Sep 17 00:00:00 2001 From: "marta.sudol" Date: Wed, 20 Aug 2025 09:24:26 +0200 Subject: [PATCH 2/5] fix: web: expo_os is not defined --- config/webpack/webpack.common.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/webpack/webpack.common.ts b/config/webpack/webpack.common.ts index bdc84bc5aa70..0cc27e285053 100644 --- a/config/webpack/webpack.common.ts +++ b/config/webpack/webpack.common.ts @@ -153,6 +153,8 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment): ...(platform === 'web' ? [new CustomVersionFilePlugin()] : []), new DefinePlugin({ ...(platform === 'desktop' ? {} : {process: {env: {}}}), + // Define EXPO_OS for web platform to fix expo-modules-core warning + 'process.env.EXPO_OS': JSON.stringify('web'), // eslint-disable-next-line @typescript-eslint/naming-convention __REACT_WEB_CONFIG__: JSON.stringify(dotenv.config({path: file}).parsed), From df85db5c28ce405adf5ed6ec07355d275f7ccbfb Mon Sep 17 00:00:00 2001 From: "marta.sudol" Date: Wed, 20 Aug 2025 09:27:29 +0200 Subject: [PATCH 3/5] ESLint --- config/webpack/webpack.common.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/config/webpack/webpack.common.ts b/config/webpack/webpack.common.ts index 0cc27e285053..f4e90fdcde2a 100644 --- a/config/webpack/webpack.common.ts +++ b/config/webpack/webpack.common.ts @@ -154,6 +154,7 @@ const getCommonConfiguration = ({file = '.env', platform = 'web'}: Environment): new DefinePlugin({ ...(platform === 'desktop' ? {} : {process: {env: {}}}), // Define EXPO_OS for web platform to fix expo-modules-core warning + // eslint-disable-next-line @typescript-eslint/naming-convention 'process.env.EXPO_OS': JSON.stringify('web'), // eslint-disable-next-line @typescript-eslint/naming-convention __REACT_WEB_CONFIG__: JSON.stringify(dotenv.config({path: file}).parsed), From 0ff57d866ee798e2382478dd0bc10312934901ce Mon Sep 17 00:00:00 2001 From: "marta.sudol" Date: Fri, 22 Aug 2025 16:30:08 +0200 Subject: [PATCH 4/5] fix: EXPO_OS not defined --- index.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/index.js b/index.js index 283120f50395..bd4ace60c2b3 100644 --- a/index.js +++ b/index.js @@ -6,5 +6,16 @@ import App from './src/App'; import Config from './src/CONFIG'; import additionalAppSetup from './src/setup'; +// Define EXPO_OS before any imports to prevent console errors from Expo DOM components +if (!process.env.EXPO_OS) { + const {Platform} = require('react-native'); + // Create a new process.env object with EXPO_OS defined + const originalEnv = process.env; + process.env = { + ...originalEnv, + EXPO_OS: Platform.OS, + }; +} + AppRegistry.registerComponent(Config.APP_NAME, () => App); additionalAppSetup(); From b77d3759842259aa360a92d4d0dbad472730e102 Mon Sep 17 00:00:00 2001 From: "marta.sudol" Date: Mon, 25 Aug 2025 09:13:16 +0200 Subject: [PATCH 5/5] fix: EXPO_OS not defined --- index.js | 2 +- metro.config.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index bd4ace60c2b3..74be36e6e757 100644 --- a/index.js +++ b/index.js @@ -7,7 +7,7 @@ import Config from './src/CONFIG'; import additionalAppSetup from './src/setup'; // Define EXPO_OS before any imports to prevent console errors from Expo DOM components -if (!process.env.EXPO_OS) { +if (!process.env.EXPO_OS && __DEV__) { const {Platform} = require('react-native'); // Create a new process.env object with EXPO_OS defined const originalEnv = process.env; diff --git a/metro.config.js b/metro.config.js index c5a321dd38bc..90ae8c6becea 100644 --- a/metro.config.js +++ b/metro.config.js @@ -33,7 +33,6 @@ const config = { inlineRequires: true, }, }), - platforms: ['ios', 'android', 'native', 'web'], }, };