Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/webpack/webpack.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ 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
// 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),

Expand Down
11 changes: 11 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 && __DEV__) {
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();
Loading