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 b74df16210
commit 2e0b5d73fd
6 changed files with 1477 additions and 52 deletions
+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)) {