timothymiller / t4-app

A powerful cross-platform UI toolkit for building actually native iOS, Android, macOS, Windows, Linux, and Progressive Web Apps with React (Native).
https://t4stack.com
MIT License
1.34k stars 71 forks source link

Fix iOS build by added missing dependency #38

Closed hmbrg closed 1 year ago

hmbrg commented 1 year ago

Prevously the pnpm ios command would build a non functioning build because the dependency react-native-safe-area-context was missing in the expo project folder.

timothymiller commented 1 year ago

Did the build crash when started without it?

hmbrg commented 1 year ago

Building doesn't fail for me (there are just the above mentioned warnings) but the app errors when being run:

 ERROR  Invariant Violation: requireNativeComponent: "RNCSafeAreaProvider" was not found in the UIManager.

This error is located at:
    in RNCSafeAreaProvider (created by SafeAreaProvider)
    in SafeAreaProvider (created by wrapper)
    in RCTView (created by View)
    in View (created by GestureHandlerRootView)

This seemed to be a react-navigation error that should only happen in bare RN projects: https://reactnavigation.org/docs/7.x/troubleshooting/#im-getting-an-error-requirenativecomponent-rncsafeareaprovider-was-not-found-in-the-uimanager

I then figured that the dependency is missing from the pod install for iOS. Placing the dependency in the expo folder directly seems to fix that. I'm not entirely sure if this is the correct solution, that's why this is a draft.

timothymiller commented 1 year ago

Building doesn't fail for me (there are just the above mentioned warnings) but the app errors when being run:

 ERROR  Invariant Violation: requireNativeComponent: "RNCSafeAreaProvider" was not found in the UIManager.

This error is located at:
    in RNCSafeAreaProvider (created by SafeAreaProvider)
    in SafeAreaProvider (created by wrapper)
    in RCTView (created by View)
    in View (created by GestureHandlerRootView)

This seemed to be a react-navigation error that should only happen in bare RN projects: https://reactnavigation.org/docs/7.x/troubleshooting/#im-getting-an-error-requirenativecomponent-rncsafeareaprovider-was-not-found-in-the-uimanager

I then figured that the dependency is missing from the pod install for iOS. Placing the dependency in the expo folder directly seems to fix that. I'm not entirely sure if this is the correct solution, that's why this is a draft.

It could be. Since we are using pnpm, we have a lot of "firsts". Thank you for taking the initiative to find a fix.

timothymiller commented 1 year ago

This project used to have react-native-navigation in the expo project. This is a lighterweight solution to adding that module to the expo project.