From f22794ef2acad499aa85142822aabeed3f716681 Mon Sep 17 00:00:00 2001 From: Pokai Chang Date: Wed, 5 Feb 2025 01:48:16 +0800 Subject: [PATCH] fix: possible expo-modules-core global type conflict with other packages Such as: Interface 'ProcessEnv' cannot simultaneously extend types 'ExpoProcessEnv' and 'Env'. Named property 'NODE_ENV' of types 'ExpoProcessEnv' and 'Env' are not identical. (Env defined in bun-types/overrides.d.ts) --- packages/vxrn/src/utils/depPatches.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/packages/vxrn/src/utils/depPatches.ts b/packages/vxrn/src/utils/depPatches.ts index 9483dee45..52d76fa45 100644 --- a/packages/vxrn/src/utils/depPatches.ts +++ b/packages/vxrn/src/utils/depPatches.ts @@ -249,6 +249,20 @@ install('URLSearchParams', () => URLSearchParams); }, }, + { + module: 'expo-modules-core', + patchFiles: { + version: '2.*', + 'src/ts-declarations/global.ts': (contents) => { + assertString(contents) + + // Make it compatible with other packages that also overrides ProcessEnv, such as `bun-types`. + // Prevents type-checking errors like "Named property 'NODE_ENV' of types 'ExpoProcessEnv' and 'Env' are not identical." + return contents.replace('NODE_ENV: string;', 'NODE_ENV?: string;') + }, + }, + }, + { module: 'expo-image', patchFiles: {