fix: Resolve mobile app crash with import.meta and babel config

- Add guard for import.meta in endpoints.ts for React Native compatibility
- Add jsEngine: jsc to app.json to match gradle.properties
- Add @babel/plugin-transform-class-static-block for @pezkuwi/types-codec
This commit is contained in:
2026-01-20 01:28:56 +03:00
parent f9bbabd215
commit 48b51828fa
6 changed files with 1477 additions and 52 deletions
+2 -1
View File
@@ -6,7 +6,8 @@
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"newArchEnabled": true,
"newArchEnabled": false,
"jsEngine": "jsc",
"splash": {
"image": "./assets/splash-icon.png",
"resizeMode": "contain",
+3
View File
@@ -9,5 +9,8 @@ module.exports = function (api) {
},
],
],
plugins: [
'@babel/plugin-transform-class-static-block',
],
};
};
+9 -1
View File
@@ -10,8 +10,16 @@ const config = getDefaultConfig(__dirname);
// ============================================
const projectRoot = __dirname;
const workspaceRoot = path.resolve(projectRoot, '..');
// Use default watchFolders (no custom configuration)
// Watch folders - include shared directory for cross-project imports
config.watchFolders = [workspaceRoot];
// Tell Metro where to resolve packages (both project and workspace node_modules)
config.resolver.nodeModulesPaths = [
path.resolve(projectRoot, 'node_modules'),
path.resolve(workspaceRoot, 'node_modules'),
];
// ============================================
// CUSTOM MODULE RESOLUTION
+1448 -47
View File
File diff suppressed because it is too large Load Diff
+6 -2
View File
@@ -44,7 +44,7 @@
"@pezkuwi/util": "^14.0.11",
"@pezkuwi/util-crypto": "^14.0.11",
"@react-native-async-storage/async-storage": "^2.2.0",
"@react-native-picker/picker": "2.11.1",
"@react-native-picker/picker": "^2.11.4",
"@react-navigation/bottom-tabs": "^7.8.5",
"@react-navigation/native": "^7.1.20",
"@react-navigation/stack": "^7.6.4",
@@ -64,12 +64,13 @@
"react": "19.1.0",
"react-dom": "19.1.0",
"react-i18next": "^16.3.3",
"react-native": "0.81.5",
"react-native-gesture-handler": "~2.28.0",
"react-native-get-random-values": "~1.11.0",
"react-native-qrcode-svg": "^6.3.11",
"react-native-safe-area-context": "^5.6.2",
"react-native-screens": "~4.16.0",
"react-native-svg": "15.12.1",
"react-native-svg": "^15.15.1",
"react-native-url-polyfill": "^3.0.0",
"react-native-vector-icons": "^10.3.0",
"react-native-web": "^0.21.0",
@@ -96,9 +97,12 @@
"@pezkuwi/util-crypto": "^14.0.11"
},
"devDependencies": {
"@babel/plugin-transform-class-static-block": "^7.28.6",
"@expo/ngrok": "^4.1.0",
"@pezkuwi/extension-dapp": "^0.62.20",
"@pezkuwi/extension-inject": "^0.62.20",
"@react-native-community/cli": "^20.1.0",
"@react-native/metro-config": "^0.83.1",
"@testing-library/jest-native": "^5.4.3",
"@testing-library/react-native": "^13.3.3",
"@types/invariant": "^2",
+9 -1
View File
@@ -122,7 +122,15 @@ export function getAllNetworks(): NetworkConfig[] {
* @returns {NetworkConfig} The active network configuration.
*/
export const getCurrentNetworkConfig = (): NetworkConfig => {
const networkName = (import.meta.env.VITE_NETWORK || 'local').toUpperCase();
let networkName = 'LOCAL';
// Support both Vite (web) and React Native environments
if (typeof process !== 'undefined' && process.env?.EXPO_PUBLIC_NETWORK) {
networkName = process.env.EXPO_PUBLIC_NETWORK.toUpperCase();
} else if (typeof import.meta !== 'undefined' && (import.meta as any).env?.VITE_NETWORK) {
networkName = ((import.meta as any).env.VITE_NETWORK || 'local').toUpperCase();
}
const validNetworkKeys = Object.keys(NETWORK_ENDPOINTS);
if (validNetworkKeys.includes(networkName)) {