Closed Pnlvfx closed 3 weeks ago
:warning: | Missing Reproducible Example |
---|---|
:information_source: | We could not detect a reproducible example in your issue report. Please provide either:
|
After updating to react-native 0.72.3 a really strange thing happen to me.
From which version are you upgrading from?
Also can you create a reproducer?
@cortinico I'm upgrading from 0.73.1 to 0.73.2, sorry there was a typo in the versions before. I don't know if I can do the repro, I will try to do it tonight.
I don't know if I can do the repro, I will try to do it tonight.
Please do as I don't see how 0.73.1 -> 0.73.2 could create this regression
@cortinico I've seen all the commits and I was thinking the same thing. I will definetely try do make a repro tonight
@cortinico copying this from reddit where I tagged you in a comment:
u/cortinico metro freezes the app in "refreshing state" AND the cli after package installs (even ctrl+c won’t work), it throws similar error like the op’s, react found a string while expecting xxx for no reason, and ~one error that I can’t remember exactly but it’s something like required files/import not found~ errors like this popping out of nowhere: TypeError: 0, _$$_REQUIRE(_dependencyMap[26(...), "react-native-size-matters").s is not a function (it is undefined)
.
Only solution for the above is to nuke metro and restart, I always have my run command to clear cache and watchman del all.
one weird this is that iOS bundle goes to 100% immediately from a cold npm start while on android it displays the bundle loading just fine. (I’m talking about the green loading indicator on metro).
this could be definitely be happening because of metro f things up, something IS there and the metro doesn’t pick it up, I also use 0.73.2
https://github.com/facebook/react-native/assets/717975/927c3857-5656-47e7-a0bd-f8ccb744c283
@efstathiosntonas that's most likely a separate issue. Please open an issue against facebook/metro then
I'm sorry if I did't provide the repro, but I'm full of work these days, I will do it when I can, do not close the issue for now because in my app it's still happening, even after I have deleted all the cache and rebuilt, and in both real phone and simulator. I've removed the component inside the tabBar for now.
Updates: It happens also with different import while reloading during development. From when I'm in 0.73.2 it happens consistently: TypeError: 0, _$$_REQUIRE(_dependencyMap[13(...)/../redux/store").useAppDispatch is not a function (it is undefined)
So I have to stop metro, and restart with reset cache. The context still missing. Sorry but I have not made the repro for now
@cortinico
Error like this happens almost every change I made, so I have to restart metro to let reload the app. Idk
@cortinico copying this from reddit where I tagged you in a comment:
u/cortinico metro freezes the app in "refreshing state" AND the cli after package installs (even ctrl+c won’t work), it throws similar error like the op’s, react found a string while expecting xxx for no reason, and ~one error that I can’t remember exactly but it’s something like required files/import not found~ errors like this popping out of nowhere:
TypeError: 0, _$$_REQUIRE(_dependencyMap[26(...), "react-native-size-matters").s is not a function (it is undefined)
.Only solution for the above is to nuke metro and restart, I always have my run command to clear cache and watchman del all.
one weird this is that iOS bundle goes to 100% immediately from a cold npm start while on android it displays the bundle loading just fine. (I’m talking about the green loading indicator on metro).
this could be definitely be happening because of metro f things up, something IS there and the metro doesn’t pick it up, I also use 0.73.2
Screen.Recording.2024-01-12.at.08.45.08.mov
Can you solve this problem ? I also have same problem.
Updates: It happens also with different import while reloading during development. From when I'm in 0.73.2 it happens consistently: TypeError: 0, _$$_REQUIRE(_dependencyMap[13(...)/../redux/store").useAppDispatch is not a function (it is undefined)
So I have to stop metro, and restart with reset cache. The context still missing. Sorry but I have not made the repro for now
Did you solve this problem ? I also have same problem.
haven't found a solution, it drived me mad at first but now I'm used to it 🤯
everytime I install a package I have to kill metro for it to work again. If I let it hanging for about a minute it starts working again.
I'm using the latest watchman available, latest metro and latest babel plugins available as of today (13 April 24).
In the past I had the same issue because of babel messing things up but it was solved after a month of struggle (by babel).
One other thing that I suspect messing things up is the Proxyman app that I use to debug network traffic, this app installs a certificate for the proxy to work and start capturing traffic. I have the same suspicion about NordVPN app.
haven't found a solution, it drived me mad at first but now I'm used to it 🤯
everytime I install a package I have to kill metro for it to work again. If I let it hanging for about a minute it starts working again.
I'm using the latest watchman available, latest metro and latest babel plugins available as of today (13 April 24).
In the past I had the same issue because of babel messing things up but it was solved after a month of struggle (by babel).
One other thing that I suspect messing things up is the Proxyman app that I use to debug network traffic, this app installs a certificate for the proxy to work and start capturing traffic. I have the same suspicion about NordVPN app.
Reset metro not work for me, I almost get crazy. I think it's about RN 0.73
do you by any chance use react-native-svg-transformer with expo-modules-core? If yes, latest release of the transformer uses the expo babel transformer instead of react-native's one and it messes things up.
do you by any chance use react-native-svg with expo-modules-core? If yes, latest release of rn-svg uses the expo metro cofnig instead of react-native's one and it messes things up.
I don't use Expo at all.
I meant react-native-svg-transformer, not svg, sorry.
I solved the error in the screenshot above by removing all expo imports and keep only the react-native ones.
If I were you I would search in the node_modules folder for references to expo babel transformer and replace with react-native by using patch-package
these lines are problematic: https://github.com/kristerkari/react-native-svg-transformer/issues/333
I don't use react-native-svg-transformer.
Now I write new function and import my code but I get error. I added all functions from new file to old functions files it's work :))
I guess I have problem with metro.
there might be other modules in your node_modules that use the same strategy to import expo babel transformer that's why I said earlier to scan the entire node_modules folder for references.
It seems watchman (at least version 2024.04.15.00
) cannot handle too many files so after adding this in .watchmanconfig
in the root of the project fixed the hanging metro for me:
{
"ignore_dirs": [".git", "ios", "android"]
}
If you want to track what watchman is watching then enter this on terminal:
watchman-wait <PATH_TO_PROJECT_ROOT> --max-events 0
My project has ~250 deps and thousands of commits in .git
folder so I think watchman is clogged somehow due to millions of files open.
Finally life is back to normal now 😅
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
Description
After upgrading to react-native 0.73.2 a really strange thing happen to me.
I have a Context provider inside my App, at the very top level.
I'm using it into 2 screen and in my custom tab bar from @react-navigation/native-stack
The error only happens in the component inside the tab-bar If I remove that component the error goes away (so the 2 screen are still working fine)
now I get the error:
Error: useNetwork must be used with NetworkProvider
This error is located at: in NetStatus (created by BabyPlayer) in BabyPlayer in Unknown (created by SafeAreaInsetsContext) in RCTView (created by View) in View (created by GestureHandlerRootView) in GestureHandlerRootView (created by SafeAreaInsetsContext) in RCTView (created by View) in View (created by SafeAreaInsetsContext) in SafeAreaProviderCompat (created by BottomTabView) in BottomTabView (created by BottomTabNavigator) in PreventRemoveProvider (created by NavigationContent) in NavigationContent in Unknown (created by BottomTabNavigator) in BottomTabNavigator (created by TabNav) in TabNav (created by TabNavigator) in SearchProvider (created by TabNavigator) in TabNavigator (created by SceneView) in StaticContainer in EnsureSingleNavigator (created by SceneView) in SceneView (created by SceneView) in RCTView (created by View) in View (created by DebugContainer) in DebugContainer (created by MaybeNestedStack) in MaybeNestedStack (created by SceneView) in RCTView (created by View) in View (created by SceneView) in RNSScreen in Unknown (created by InnerScreen) in Suspender (created by Freeze) in Suspense (created by Freeze) in Freeze (created by DelayedFreeze) in DelayedFreeze (created by InnerScreen) in InnerScreen (created by Screen) in Screen (created by SceneView) in SceneView (created by NativeStackViewInner) in Suspender (created by Freeze) in Suspense (created by Freeze) in Freeze (created by DelayedFreeze) in DelayedFreeze (created by ScreenStack) in RNSScreenStack (created by ScreenStack) in ScreenStack (created by NativeStackViewInner) in NativeStackViewInner (created by NativeStackView) in RCTView (created by View) in View (created by SafeAreaInsetsContext) in SafeAreaProviderCompat (created by NativeStackView) in NativeStackView (created by NativeStackNavigator) in PreventRemoveProvider (created by NavigationContent) in NavigationContent in Unknown (created by NativeStackNavigator) in NativeStackNavigator (created by PlayerStackNavigator) in PlayerStackNavigator (created by SceneView) in StaticContainer in EnsureSingleNavigator (created by SceneView) in SceneView (created by SceneView) in RCTView (created by View) in View (created by DebugContainer) in DebugContainer (created by MaybeNestedStack) in MaybeNestedStack (created by SceneView) in RCTView (created by View) in View (created by SceneView) in RNSScreen in Unknown (created by InnerScreen) in Suspender (created by Freeze) in Suspense (created by Freeze) in Freeze (created by DelayedFreeze) in DelayedFreeze (created by InnerScreen) in InnerScreen (created by Screen) in Screen (created by SceneView) in SceneView (created by NativeStackViewInner) in Suspender (created by Freeze) in Suspense (created by Freeze) in Freeze (created by DelayedFreeze) in DelayedFreeze (created by ScreenStack) in RNSScreenStack (created by ScreenStack) in ScreenStack (created by NativeStackViewInner) in NativeStackViewInner (created by NativeStackView) in RNCSafeAreaProvider (created by SafeAreaProvider) in SafeAreaProvider (created by SafeAreaInsetsContext) in SafeAreaProviderCompat (created by NativeStackView) in NativeStackView (created by NativeStackNavigator) in PreventRemoveProvider (created by NavigationContent) in NavigationContent in Unknown (created by NativeStackNavigator) in NativeStackNavigator (created by MainStackNavigator) in MainStackNavigator (created by App) in EnsureSingleNavigator in BaseNavigationContainer in ThemeProvider in NavigationContainerInner (created by App) in MsgProvider (created by App) in NetworkProvider (created by App) in SessionProvider (created by App) in Provider (created by App) in App in RCTView (created by View) in View (created by AppContainer) in RCTView (created by View) in View (created by AppContainer) in AppContainer
You can clearly see, here at the bottom, that the NetworkProvider is here, I don't know if it's a bug, or a false error, or what has been broken. I'm reporting this so that someone with more experience could understand what happens.
Also I've seen that if I comment out the component, load the app, and then reactivate the component the error does not fire. Usually when a context is missing, if you reactivate the component the error still fire any time.
Steps to reproduce
It happens immediatly after opening the app
React Native Version
0.73.2
Affected Platforms
Runtime - iOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
no-reproducer
Screenshots and Videos
https://github.com/facebook/react-native/assets/93389293/cd8916d9-3f30-4872-af50-43577a14150b