roninoss / rn-primitives

Style-agnostic, accessible React Native components for iOS, Android, and Web
https://rnprimitives.com
MIT License
424 stars 12 forks source link

dev:example not compiling #19

Closed leifdejong closed 2 months ago

leifdejong commented 4 months ago

System: Mac OSX 14.5 M1 Macbook Pro Node: v20.11.1 pnpm: 9.5.0

Metro build fails with:

Metro has encountered an error: While trying to resolve module `@rn-primitives/slider` from file `/Users/leifdejong/workspace/rn-primitives/apps/example/app/(components)/slider.tsx`, the package `/Users/leifdejong/workspace/rn-primitives/apps/example/node_modules/@rn-primitives/slider/package.json` was successfully found. However, this package itself specifies a `main` module field that could not be resolved

Solution:

Adding "prepare": "npm run build" to the "scripts" object on the root of the monorepo's package.json

leifdejong commented 4 months ago

I guess you did specify pnpm dev:primitives in README.md. Wasn't quite clear it is a dependency to running the example. Perhaps just adding it to the "prepare" property or being more specific in the docs will avoid this confusion. The only problem is dev:primatives doesn't close the process compared with the build command 🤷🏻.