Comments (8)
Just coming back to say this fix here worked for me.
"resolutions": {
"react": "18.2.0",
"react-dom": "18.2.0",
},
from tamagui.
@TheEhsanSarshar The issue is unfornutely not fixed in the latest version. The problem is that tamagui has a peer dependency of react-native-web@*, which has a peer dependency of react-dom@^18.0.0. There is a new version of react-dom 18.3 which has a peer dependency [email protected], which is not a part of the current expo (50.0.17).
I can't think of any simple solution how to fix it. Just be aware that the issue still exists and the resolutions is probably the best solution for now.
from tamagui.
I made it to that error now as well, after:
- adding
tamagui
,@tamagui/config
andesbuild
(dev dep) using the--legacy-peer-deps
flag for npm - Copying over some code from a template project that differs from the guide on the website
Edit: In case this is helpful, here's the full error log:
ERROR Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
at Provider (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:164868:30)
at TamaguiProvider (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:171811:26)
at TamaguiProvider (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:198000:26)
at RootLayout (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:198887:55)
at Suspense
at Route (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:140007:24)
at Route() (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:140360:24)
at RNCSafeAreaProvider
at SafeAreaProvider (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:136967:24)
at wrapper (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:149405:27)
at EnsureSingleNavigator (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:131016:24)
at BaseNavigationContainer (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:129512:28)
at ThemeProvider (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:135315:21)
at NavigationContainerInner (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:149828:26)
at ContextNavigator (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:149440:24)
at ExpoRoot (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:149396:28)
at App
at ErrorToastContainer (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:253787:24)
at ErrorOverlay
at withDevTools(ErrorOverlay) (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:253537:27)
at RCTView
at View (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:40236:43)
at RCTView
at View (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:40236:43)
at AppContainer (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:40047:36)
at main(RootComponent) (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:124358:28)
ERROR Warning: Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
1. You might have mismatching versions of React and the renderer (such as React DOM)
2. You might be breaking the Rules of Hooks
3. You might have more than one copy of React in the same app
See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.
at Provider (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:164868:30)
at TamaguiProvider (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:171811:26)
at TamaguiProvider (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:198000:26)
at RootLayout (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:198887:55)
at Suspense
at Route (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:140007:24)
at Route() (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:140360:24)
at RNCSafeAreaProvider
at SafeAreaProvider (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:136967:24)
at wrapper (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:149405:27)
at EnsureSingleNavigator (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:131016:24)
at BaseNavigationContainer (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:129512:28)
at ThemeProvider (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:135315:21)
at NavigationContainerInner (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:149828:26)
at ContextNavigator (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:149440:24)
at ExpoRoot (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:149396:28)
at App
at ErrorToastContainer (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:253787:24)
at ErrorOverlay
at withDevTools(ErrorOverlay) (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:253537:27)
at RCTView
at View (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:40236:43)
at RCTView
at View (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:40236:43)
at AppContainer (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:40047:36)
at main(RootComponent) (http://10.0.2.2:8081/node_modules/expo-router/entry.bundle//&platform=android&dev=true&lazy=true&minify=false&app=app.getinner.inner&modulesOnly=false&runModule=true&transform.routerRoot=app&transform.engine=hermes&transform.bytecode=true:124358:28)
ERROR TypeError: Cannot read property 'useMemo' of null
This error is located at:
in Provider
in TamaguiProvider (created by TamaguiProvider)
in TamaguiProvider (at _layout.tsx:11)
in RootLayout (at useScreens.js:112)
in Unknown (at useScreens.js:116)
in Suspense (at useScreens.js:115)
in Route (at useScreens.js:131)
in Route() (at ExpoRoot.js:90)
in RNCSafeAreaProvider (at SafeAreaContext.tsx:92)
in SafeAreaProvider (at ExpoRoot.js:55)
in wrapper (at ExpoRoot.js:89)
in EnsureSingleNavigator (at BaseNavigationContainer.tsx:433)
in BaseNavigationContainer (at NavigationContainer.native.js:105)
in ThemeProvider (at NavigationContainer.native.js:104)
in NavigationContainerInner (at ExpoRoot.js:86)
in ContextNavigator (at ExpoRoot.js:64)
in ExpoRoot (at qualified-entry.js:20)
in App (created by ErrorOverlay)
in ErrorToastContainer (created by ErrorOverlay)
in ErrorOverlay (at withDevTools.js:18)
in withDevTools(ErrorOverlay) (at renderApplication.js:57)
in RCTView (at View.js:116)
in View (at AppContainer.js:127)
in RCTView (at View.js:116)
in View (at AppContainer.js:155)
in AppContainer (at renderApplication.js:50)
in main(RootComponent) (at renderApplication.js:67), js engine: hermes
ERROR TypeError: Cannot read property 'useMemo' of null
This error is located at:
in Provider
in TamaguiProvider (created by TamaguiProvider)
in TamaguiProvider (at _layout.tsx:11)
in RootLayout (at useScreens.js:112)
in Unknown (at useScreens.js:116)
in Suspense (at useScreens.js:115)
in Route (at useScreens.js:131)
in Route() (at ExpoRoot.js:90)
in RNCSafeAreaProvider (at SafeAreaContext.tsx:92)
in SafeAreaProvider (at ExpoRoot.js:55)
in wrapper (at ExpoRoot.js:89)
in EnsureSingleNavigator (at BaseNavigationContainer.tsx:433)
in BaseNavigationContainer (at NavigationContainer.native.js:105)
in ThemeProvider (at NavigationContainer.native.js:104)
in NavigationContainerInner (at ExpoRoot.js:86)
in ContextNavigator (at ExpoRoot.js:64)
in ExpoRoot (at qualified-entry.js:20)
in App (created by ErrorOverlay)
in ErrorToastContainer (created by ErrorOverlay)
in ErrorOverlay (at withDevTools.js:18)
in withDevTools(ErrorOverlay) (at renderApplication.js:57)
in RCTView (at View.js:116)
in View (at AppContainer.js:127)
in RCTView (at View.js:116)
in View (at AppContainer.js:155)
in AppContainer (at renderApplication.js:50)
in main(RootComponent) (at renderApplication.js:67), js engine: hermes
from tamagui.
This is fixed with latest version of tamagui
from tamagui.
Same here but in my case, I just update React Native and Sentry, This was enough to start breaking my application reporting problems with tamaguiProvider with useMemo.
from tamagui.
Just tacking on here with the exact issue. useFonts is showing up in the callstack for some reason.
Versions:
"tamagui": "^1.95.3",
"@tamagui/animations-moti": "^1.95.3",
"@tamagui/babel-plugin": "^1.95.3",
"@tamagui/config": "^1.95.3",
"@tamagui/font-inter": "^1.95.3",
"@tamagui/lucide-icons": "^1.95.3",
"@tamagui/metro-plugin": "^1.95.3",
"@tamagui/themes": "^1.95.3",
"expo": "^50.0.17",
"expo-font": "~11.10.3",
Initially, I was only getting a white screen on my first app load. I removed ./node_modules and ran yarn, now I get the "TypeError: Cannot read property 'useMemo' of null" error and with the invaild hook call warning.
Still digging around for a resolution.
from tamagui.
Just coming back to say this fix here worked for me.
"resolutions": { "react": "18.2.0", "react-dom": "18.2.0", },
Thanks @JohnAnselmi, it seems to do the trick for now! Hopefully this gets permanently fixed soon 🙏
from tamagui.
Just coming back to say this fix here worked for me.
"resolutions": { "react": "18.2.0", "react-dom": "18.2.0", },
Thanks a lot, @JohnAnselmi worked for me too!!!
from tamagui.
Related Issues (20)
- Error when build application with animations-moti HOT 3
- Button pressStyle stuck on after first press HOT 1
- Cannot find module 'react-dom' from Tamagui 1.97.0 in bare React Native HOT 2
- Why does TamaGUI has so big slowdown in performance? HOT 2
- Input component Errors out on React Native: Cannot read property useRef of null HOT 21
- screen will flash when too fast to toggle two dialog.
- `ListItem` ignores `borderRadius`
- borderStyle is ignored when borderRadius is set
- create tamagui@latest start with a bug on mobile HOT 5
- Updated to Expo 50 - Now Can't find Module (lucide-icons) HOT 2
- Component specific theme - without light_ prefix, doesn't apply
- Expo router starter has wrong colorScheme on device set on light mode HOT 7
- Installation with Expo requires config HOT 1
- Individual border radius properties are ignored on web
- `tabIndex={0}` dont seems to set the `accessible` props on IOS
- Tamagui Switch looks broken on web by default HOT 1
- Group and FlatList HOT 1
- Popover on web not closing when clicking outside or hitting scape HOT 5
- [Next.Js] Error when rendering a non client component: cannot access Image.propTypes on the server.
- Dialog.Content persists in view, when Dialog is closed. (Only when a child has `animation` prop) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tamagui.