From 4c48e4e1c3d5ef0443e31152fe40eb4c041ad137 Mon Sep 17 00:00:00 2001 From: Hubert Bieszczad Date: Wed, 21 Jan 2026 14:45:22 +0100 Subject: [PATCH] fix: resolve react native directories that are not node_modules --- packages/uniwind/src/metro/resolvers.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/uniwind/src/metro/resolvers.ts b/packages/uniwind/src/metro/resolvers.ts index aecb2374..c8c64322 100644 --- a/packages/uniwind/src/metro/resolvers.ts +++ b/packages/uniwind/src/metro/resolvers.ts @@ -52,11 +52,16 @@ export const nativeResolver = ({ } const isInternal = cachedComponentsBasePath !== '' && context.originModulePath.startsWith(cachedComponentsBasePath) + const isFromNodeModules = context.originModulePath.includes(`${sep}node_modules${sep}`) const isFromReactNative = context.originModulePath.includes(`${sep}react-native${sep}`) || context.originModulePath.includes(`${sep}@react-native${sep}`) const isReactNativeAnimated = context.originModulePath.includes(`${sep}Animated${sep}components${sep}`) - if (isInternal || resolution.type !== 'sourceFile' || (isFromReactNative && !isReactNativeAnimated)) { + if ( + isInternal // Is from uniwind + || resolution.type !== 'sourceFile' // Is not a source file + || (isFromReactNative && isFromNodeModules && !isReactNativeAnimated) // Is from react-native but not Animated + ) { return resolution }