Skip to content

Commit

Permalink
fix: possible expo-modules-core global type conflict with other packages
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
zetavg committed Feb 4, 2025
1 parent 260d41c commit f22794e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/vxrn/src/utils/depPatches.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit f22794e

Please sign in to comment.