bamlab/react-native-screen-sizer

Can't install in an expo snack: Invalid module ../assets/images/LeftArrow.png

Opened this issue · 0 comments

Reproduction: https://snack.expo.dev/@matthieugc/blissful-blue-marshmallows

Capture d’écran 2023-10-05 à 09 22 57
Failed to resolve dependency '@bam.tech/react-native-screen-sizer@0.3.0' (Invalid module ../assets/images/LeftArrow.png - Module not found: Error: Can't resolve '../assets/images/LeftArrow.png' in '/tmp/snackager/snackager/buildStatus/1/@bam.tech~react-native-screen-sizer@0.3.0-ios,android,web/package/lib/module')

It seems like snack uses the "module" field in package.json (pointing to ./lib/module) as an entrypoint (not the "react-native" field pointing to (./src), and since there's one more folder level, the assets path is invalid (should be "../../" instead of "../")