tamagui: [bug] Expo - Error: No parent manager given

Describe the bug Following the new Expo guide for setting up tamagui with Expo 48 and the latest tamagui (1.5.22), I get the following error when running expo start -c:

Error: No parent manager given

This error is located at:
    in _Theme (created by App)
    in PortalProviderComponent
    in _Theme (created by _ThemeProvider)
    in _ThemeProvider (created by _TamaguiProvider)
    in _TamaguiProvider
    in Unknown (created by App)
    in ActiveTripProvider (created by App)
    in QueryClientProvider (created by App)
    in App (created by withDevTools(App))
    in withDevTools(App)
    in RCTView (created by View)
    in View (created by AppContainer)
    in RCTView (created by View)
    in View (created by AppContainer)
    in AppContainer
    in main(RootComponent), js engine: hermes
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:102:17 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:148:19 in handleException
at node_modules/react-native/Libraries/Core/ReactFiberErrorDialog.js:52:19 in showErrorDialog
at src/hooks/useCachedResources.ts:25:26 in loadResourcesAndDataAsync
at /private/var/folders/qp/ympy822d7j97b4q14r7lx30w0000gn/T/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:53:15 in tryCallOne
at /private/var/folders/qp/ympy822d7j97b4q14r7lx30w0000gn/T/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:139:26 in anonymous
- ... 7 more stack frames from framework internals

[Unhandled promise rejection: Error: No parent manager given]
at node_modules/@tamagui/web/dist/cjs/helpers/ThemeManager.js:46:23 in constructor
at node_modules/@tamagui/web/dist/cjs/hooks/useTheme.js:195:50 in createState
at node_modules/react/cjs/react.development.js:1622:28 in useState
at node_modules/@tamagui/web/dist/cjs/hooks/useTheme.js:155:63 in useChangeThemeEffect
at node_modules/@tamagui/web/dist/cjs/views/Theme.js:36:61 in Theme
at src/hooks/useCachedResources.ts:25:26 in loadResourcesAndDataAsync
at /private/var/folders/qp/ympy822d7j97b4q14r7lx30w0000gn/T/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:53:15 in tryCallOne
at /private/var/folders/qp/ympy822d7j97b4q14r7lx30w0000gn/T/hermes/build_iphonesimulator/lib/InternalBytecode/InternalBytecode.js:139:26 in anonymous
- ... 7 more stack frames from framework internals

To Reproduce

Make your changes and then push and link it here. πŸ™πŸ™πŸ™πŸ™πŸ™

System Info (please complete the following information):

System:
    OS: macOS 13.1
    CPU: (8) arm64 Apple M1
    Memory: 79.97 MB / 8.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.19.1 - ~/.nvm/versions/node/v16.19.1/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.19.1/bin/yarn
    npm: 8.19.3 - ~/.nvm/versions/node/v16.19.1/bin/npm
    Watchman: 2023.02.06.00 - /opt/homebrew/bin/watchman
  Browsers:
    Chrome: 110.0.5481.177
    Firefox: 109.0.1
    Safari: 16.2
  npmPackages:
    @babel/core: ^7.12.9 => 7.20.12
    @expo/vector-icons: ^13.0.0 => 13.0.0
    @react-native-community/cli-debugger-ui: ^10.0.0 => 10.0.0
    @react-navigation/bottom-tabs: ^6.0.5 => 6.5.4
    @react-navigation/native: ^6.0.2 => 6.1.3
    @react-navigation/native-stack: ^6.1.0 => 6.9.9
    @tamagui/animations-react-native: ^1.5.22 => 1.5.22
    @tamagui/animations-reanimated: ^1.2.14 => 1.2.14
    @tamagui/babel-plugin: ^1.5.22 => 1.5.22
    @tamagui/config: ^1.5.22 => 1.5.22
    @tamagui/font-inter: ^1.5.22 => 1.5.22
    @tamagui/lucide-icons: ^1.2.14 => 1.2.14
    @tamagui/shorthands: ^1.2.14 => 1.2.14
    @tamagui/theme-base: ^1.5.21 => 1.5.21
    @tanstack/react-query: ^4.24.6 => 4.24.6
    @tanstack/react-query-devtools: ^4.24.6 => 4.24.6
    @types/react: ~18.0.24 => 18.0.27
    @types/react-native: ~0.70.6 => 0.70.10
    babel-plugin-inline-dotenv: ^1.7.0 => 1.7.0
    babel-plugin-transform-inline-environment-variables: ^0.4.4 => 0.4.4
    cross-env: ^7.0.3 => 7.0.3
    dotenv: ^16.0.3 => 16.0.3
    expo: ^48.0.0 => 48.0.4
    expo-asset: ~8.9.0 => 8.9.0
    expo-constants: ~14.2.1 => 14.2.1
    expo-dev-client: ~2.1.3 => 2.1.3
    expo-font: ^11.1.1 => 11.1.1
    expo-linear-gradient: ~12.1.1 => 12.1.1
    expo-linking: ~4.0.1 => 4.0.1
    expo-splash-screen: ~0.18.1 => 0.18.1
    expo-status-bar: ~1.4.4 => 1.4.4
    expo-system-ui: ~2.2.1 => 2.2.1
    expo-web-browser: ~12.1.1 => 12.1.1
    jest: ^29.2.1 => 29.4.3
    jest-expo: ~47.0.1 => 47.0.1
    react: 18.2.0 => 18.2.0
    react-dom: ^18.2.0 => 18.2.0
    react-native: 0.71.3 => 0.71.3
    react-native-quick-base64: ^2.0.5 => 2.0.5
    react-native-reanimated: ^2.14.4 => 2.14.4
    react-native-safe-area-context: 4.5.0 => 4.5.0
    react-native-screens: ~3.20.0 => 3.20.0
    react-native-svg: 13.4.0 => 13.4.0
    react-native-web: ^0.18.12 => 0.18.12
    react-test-renderer: 18.1.0 => 18.1.0
    tamagui: ^1.5.22 => 1.5.22
    typescript: ^4.6.3 => 4.9.5
  • yarn.lock or similar
  • If it’s a specific file, add //! debug to the top (the ! works in esbuild compiled packages but not necessary always) and include that (only for compiler, but helps to know if it’s on or off).
  • Run your server/bundler with DEBUG=tamagui and include that output at the bottom.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 3
  • Comments: 26 (8 by maintainers)

Most upvoted comments

This issue still happens when using storybook for some reason

In @tamagui/feather-icons, it is same error regarding parent. in @tamagui/lucide-icons, we get an error in the function getMediaKeyImportance when calling indexOf on mediaKeysOrdered which is apparently undefined. In each case, it seems the icon libraries are having a difficult time reading the config form the provider.

I ran into the exact same issue. In my case it was not a dependency issue it was simply me forgetting to add the TamaguiProvider to Expo.

Yes yarn is much better supported in React Native and honestly it has all the same features and speed of pnpm. No reason not to use it.

Every time I’ve tried to use pnpm with a RN project it’s ended in bad times. Highly recommend against it.

Okay. So it turns out that lucide-icons was at version 1.8.4, whereas everything else was at 1.8.1. Reverting it to 1.8.1 solved the issue.

This does strike me as a bit of a pain point though. Do you have a recommended solution for maintaining the same package version across all tamagui packages? ( This is not a complaint btw, thanks for much for the work you are doing ).