bamlab / bamlab/react-native-screen-sizer

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

Offen
#19 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
22
Forks
2
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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 "../")

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Inspect package.json and the published lib/module entrypoint, then compare the asset reference to the source path under src. Reproduce the install in the linked Expo Snack and verify that LeftArrow.png resolves successfully when the package is installed.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
react-native, typescript
Bereich
mobile
Issue-Typ
Bug
Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
50/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.