react-native: [iOS] Simulator error message `Unable to find module for DevLoadingView`
Environment
React Native Environment Info: System: OS: macOS High Sierra 10.13.6 CPU: x64 Intel® Core™ i7-7820HQ CPU @ 2.90GHz Memory: 2.85 GB / 16.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 8.10.0 - ~/.nvm/versions/node/v8.10.0/bin/node Yarn: 1.13.0 - /usr/local/bin/yarn npm: 5.6.0 - ~/.nvm/versions/node/v8.10.0/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 Android SDK: Build Tools: 23.0.1, 25.0.2, 25.0.3, 26.0.1, 26.0.2, 27.0.1, 27.0.3, 28.0.2, 28.0.3 API Levels: 23, 25, 26, 27 IDEs: Android Studio: 3.1 AI-173.4907809 Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: react: 16.6.3 => 16.6.3 react-native: 0.58.3 => 0.58.3 npmGlobalPackages: react-native-git-upgrade: 0.2.7
Description
Recently upgraded to RN 0.58.3 (from 0.57.8) via react-native-git-upgrade
. Everything compiles just fine.
However, invoking a debug run via react-native run-ios
will result in an immediate error message:
Notes:
- Reloads (cmd-R) of a running app clear the error. (App runs as expected)
- Subsequent reloads (cmd-R) of already running app do not trigger the error. (App runs as expected)
- Closing either the simulator itself and restarting, OR closing the running app within the simulator session and relaunching will trigger the error once again.
- Each of the 0.58.0, 0.58.1, 0.58.2, 0.58.3 releases give the same results.
Reproducible Demo
In my case it was simply upgrading to RN 0.58.3 from 0.57.8 via react-native-git-upgrade
then running react-native run-ios
to encounter the error message.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 61
- Comments: 31 (7 by maintainers)
Links to this issue
Commits related to this issue
- Fix module load issue: https://github.com/facebook/react-native/issues/23235 — committed to karanjthakkar/ReactNativeDevLoadingViewIssue by karanjthakkar 5 years ago
- Don't attempt to load RCTDevLoadingView lazily Summary: There's a very old issue with reload logic: invalidation and resetting up of the bridge could be racing. In this case, we hit a redbox when: * ... — committed to facebook/react-native by fkgozali 5 years ago
- Don't attempt to load RCTDevLoadingView lazily Summary: There's a very old issue with reload logic: invalidation and resetting up of the bridge could be racing. In this case, we hit a redbox when: * ... — committed to facebook/react-native by fkgozali 5 years ago
- Don't attempt to load RCTDevLoadingView lazily Summary: There's a very old issue with reload logic: invalidation and resetting up of the bridge could be racing. In this case, we hit a redbox when: * ... — committed to facebook/react-native by fkgozali 5 years ago
- Don't attempt to load RCTDevLoadingView lazily Summary: There's a very old issue with reload logic: invalidation and resetting up of the bridge could be racing. In this case, we hit a redbox when: * ... — committed to ericlewis/react-native by fkgozali 5 years ago
- Don't attempt to load RCTDevLoadingView lazily Summary: There's a very old issue with reload logic: invalidation and resetting up of the bridge could be racing. In this case, we hit a redbox when: * ... — committed to microsoft/react-native-macos by fkgozali 5 years ago
@superguineapig I just hit this too. Fixed by going to the simulator menu and hitting
Hardware
>Erase All Content and Settings...
thenHardware
>Restart
. Hardware restart might not be necessary…I think the simulator restarts anyway after clearing stuff.Now I’ve got a new error to solve about a missing Pod 😃, but thats specific to my project.
Same here on 0.60.4.
Getting this on RN58.4 - pretty annoying.
Seems like a bug in RN 0.58.3, I’m seeing this in a freshly created project.
This should be fixed with this commit: https://github.com/facebook/react-native/commit/a9dd828c68338dbf0e55ffa1838bf8ff574f317d – will be picked to the RC branches
I got it to work as well. All I had to do was disable the remote debugger.
When the simulator failed, I opened the tools with
Command + D
and disabled the debugger.I’ve managed to resolve the red box by making this change: https://github.com/karanjthakkar/ReactNativeDevLoadingViewIssue/commit/e1a637cd82bf45e6af6814746d863b131b76ac62
NOTE: THIS IS A HACK. It only works for 0.59.0-rc.0 and upwards. That is because they use
initWithDelegate
to initialise the RN bridge.For folks on an older version(<= 0.58), please do these two things:
AppDelegate.m
with this file: https://github.com/facebook/react-native/blob/da5b5d2fa134aa09dda4a620be9fa4d3d419201f/template/ios/HelloWorld/AppDelegate.m. After replacing, remember to update themoduleName
fromHelloWorld
to whatever is there in yourapp.json
AppDelegate.h
file by this one: https://github.com/facebook/react-native/blob/da5b5d2fa134aa09dda4a620be9fa4d3d419201f/template/ios/HelloWorld/AppDelegate.h NOTE: If you’re replacing any files, make sure you copy any custom code you added to it in the past.Why this fix works?
By returning YES from the
bridge:didNotFindModule
method, it enters theif
condition here instead of going to theelse
condition where it runs into the error.Still seeing it on 0.60.4
@fkgozali I’m still seeing this issue on real device (ios), with react native 0.59.3. It must be something else going on.
@dongcaiying Yes, after refreshing it on the error screen it works. But then you have to refresh 2 times. This answer on stack overflow solved the issue for me.
+1 Same error on
0.60.4
Issue occurring here also. React Native 0.59.8 (Expo SDK 33), with iOS on iPhone (not simulator). Reloading the bundle works, but on reload after a change this comes up sporadically.
This is happening as a part of the latest
0.59.0-rc1
as well.Steps to reproduce:
react-native init
The error for the redbox was added in https://github.com/facebook/react-native/commit/d7a0c44590bcf3fb9d055aeae3391d5bcd7e21be but that in itself is a part of a series of commits for lazy loading native modules by @fkgozali.
Note: This error is non blocking. iiuc, you can dismiss the red box and your RN screen will still be loaded behind it.
@kelset Do you have any ideas how we can get this issue resolved?
Awesome, good luck with your Pod hunt!
For those building to a device: I had the same issue on my iPhone (XR) rather than in simulator, solution was to delete the app through the phone and then re-trust the developer in Settings > General > Device Management.
First time encountered this after upgrading from
0.59.10
to0.60.4
. In my case it happens when I try to refresh (⌘
+R
) iOS simulator.Thanks for reporting this, I’ve flagged this as something we should address before 0.59 hits stable.
The same issue on a real device. Seems like an application starts before js bundle is created
@algera You can disable it, then re-enable it. It would appear it just needs to be toggled off when you’re starting up.
@samcorcos how am i suppose to disable the disable the debugger?