roninoss / nativewindui

Carefully crafted components that strive for a native look & feel. The perfect starting point for those that need to ship fast, and look good while doing it.
https://nativewindui.com
306 stars 6 forks source link

Expo SDK 52 - Error: Cannot read property 'regular' of undefined #19

Open h14h opened 3 hours ago

h14h commented 3 hours ago

I got this error after attempting to upgrade my NWUI app to SDK 52, and was able to reproduce it with a minimal Expo example.

Here are my approximate reproduction steps:

  1. npx create-expo-app sdk-test --template tabs
  2. cd sdk-test
  3. Follow the NWUI manual installation instructions
  4. Replace app/(tabs)/index.ts with the "Usage Example" in Step 8
  5. npx expo prebuild --clean followed by npm run ios

When the ios simulator starts up, the app crashes with Error: Cannot read property 'regular' of undefined.

mrzachnugent commented 3 hours ago

Hey @h14h , I think this has to do with https://github.com/roninoss/nativewindui/blob/main/theme/index.ts where the navigation theme now has a font in react-navigation7. You can spread ...DefaultTheme and ...DarkTheme at the top of the light and dark objects respectively.

h14h commented 2 hours ago

@mrzachnugent Thanks! That did it :+1:

In that case, I think this issue can be (at least partially) resolved by tweaking the theme/color.ts example in the manual installation instructions.

If I get around to making a PR for the issues I noted in #20, I'll address this there too.