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.
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.
This is fixed with latest version of tamagui
from tamagui.
Related Issues (20)
- Tamagui throws error when using Expo 51 New Arch HOT 16
- DatePicker on mobile HOT 2
- Can't upgrade to expo 50 HOT 1
- Tamagui class font weights broken when upgrading to Expo 51 HOT 1
- [Documentation] Changing package manager does not change the command on other code block HOT 3
- [Feature request] Wrap Burnt alerts
- Please Update lucide icon version
- Why can't the website open? HOT 2
- SVG tags being wrapped HOT 4
- Render Error: Cannot read property 'state' of undefined HOT 1
- [Bug] Select Trigger causes submission when inside a form (Web)
- Enter animations don't work with CSS HOT 1
- Datepicker Bento Component Error Android Only HOT 1
- @tamagui/constants esm build is missing platform-specific .mjs files HOT 8
- 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 13
- screen will flash when too fast to toggle two dialog.
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.