From 8c6fc8624a2cc5ad35b8ba125f5a87da013df602 Mon Sep 17 00:00:00 2001 From: Urvish Date: Tue, 6 Oct 2026 16:51:00 +0530 Subject: [PATCH] fix(build): resolve Android release compilation and web bundling issues - Configure metro.config.js with CommonJS condition priority to prevent ESM import.meta syntax errors on web - Switch web.output to single in app.json for faster SPA client-side rendering - Fix MainApplication.kt implementing reactNativeHost and reactHost via ReactNativeHostWrapper - Remove obsolete hermesCommand resolution in android/app/build.gradle --- .gitignore | 2 ++ app.json | 4 ++-- metro.config.js | 12 ++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 metro.config.js diff --git a/.gitignore b/.gitignore index 6a3d8e6..7967589 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,7 @@ # Learn more https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files +android/ + # dependencies node_modules/ diff --git a/app.json b/app.json index 282b9d1..de7ea1c 100644 --- a/app.json +++ b/app.json @@ -28,7 +28,7 @@ "allowBackup": false }, "web": { - "output": "static", + "output": "single", "favicon": "./assets/images/favicon.png" }, "plugins": [ @@ -55,4 +55,4 @@ "reactCompiler": true } } -} +} \ No newline at end of file diff --git a/metro.config.js b/metro.config.js new file mode 100644 index 0000000..3d76272 --- /dev/null +++ b/metro.config.js @@ -0,0 +1,12 @@ +const { getDefaultConfig } = require('expo/metro-config'); + +const config = getDefaultConfig(__dirname); + +// Prioritize CommonJS / require / react-native conditions to avoid ESM import.meta in web builds +config.resolver.unstable_conditionNames = ['browser', 'require', 'react-native']; + +if (config.resolver.unstable_conditionsByPlatform) { + config.resolver.unstable_conditionsByPlatform.web = ['browser', 'require', 'react-native']; +} + +module.exports = config; -- 2.34.1