Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] Simulator error message Unable to find module for DevLoadingView #23235

Closed
superguineapig opened this issue Jan 31, 2019 · 31 comments
Closed
Labels
Bug Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.

Comments

@superguineapig
Copy link

Environment

React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) 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:

error

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.

@snobear
Copy link

snobear commented Feb 1, 2019

@superguineapig I just hit this too. Fixed by going to the simulator menu and hitting Hardware > Erase All Content and Settings... then Hardware > 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.

@matttturnbull
Copy link

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.

@superguineapig
Copy link
Author

superguineapig commented Feb 1, 2019

Thanks @snobear ! That seems to have (EDIT: temporarily) cleared it up.

(Aside: I had some (unrelated to this issue) Pod troubles after using react-native-git-upgrade Long story short, I needed to do a pod install then pod update again after each upgrade to restore something that got reset in the process. I didn't notice the changes at first because they were not being tracked by my git setup. Anyway, thanks again, and good luck!)

EDIT: The error seems to be intermittent, even after resetting the simulator.

@samcorcos
Copy link
Contributor

samcorcos commented Feb 2, 2019

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.

@Utkarshmalik
Copy link

Utkarshmalik commented Feb 2, 2019

@samcorcos how am i suppose to disable the disable the debugger?

@Adichilla
Copy link

@Utkarshmalik For ios simulator press cmd+D it will open up popup from there you can disable the debugger. For Android press cmd+m to do the same.

@algera
Copy link

algera commented Feb 5, 2019

Why are you disabling the debugger? What if you want to debug?

@samcorcos
Copy link
Contributor

@algera You can disable it, then re-enable it. It would appear it just needs to be toggled off when you're starting up.

@alexverbitsky
Copy link

alexverbitsky commented Feb 6, 2019

The same issue on a real device. Seems like an application starts before js bundle is created

@superguineapig
Copy link
Author

Update: Still seeing the error intermittently a few days after following the simulator reset procedure above (#23235 (comment)) Typically only when the simulator itself is launched and is not already running before opening the target app.

@animaonline
Copy link

Seems like a bug in RN 0.58.3, I'm seeing this in a freshly created project.

@ragamufin
Copy link

I deleted the app from the simulator, stopped the packager and then cleaned my build folder and then built again. The error came back after the app was installed again and I tried to debug but stopping the debugger, refreshing the browser then restarting the debugger got rid of the error and I was able to debug and see console messages after that.

@alexfoxy
Copy link

Getting this on RN58.4 - pretty annoying.

@karanjthakkar
Copy link
Contributor

This is happening as a part of the latest 0.59.0-rc1 as well.

Steps to reproduce:

  1. Init a project with react-native init
  2. Run in simulator/device
  3. Once RN screen loads, enabled JS debugging
  4. (IMPORTANT) Close the app
  5. Open the app again
  6. You will see the redbox error

The error for the redbox was added in d7a0c44 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?

karanjthakkar added a commit to karanjthakkar/ReactNativeDevLoadingViewIssue that referenced this issue Feb 15, 2019
@karanjthakkar
Copy link
Contributor

I've managed to resolve the red box by making this change: karanjthakkar/ReactNativeDevLoadingViewIssue@e1a637c

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:

  1. Replace your AppDelegate.m with this file: https://github.com/facebook/react-native/blob/da5b5d2fa134aa09dda4a620be9fa4d3d419201f/template/ios/HelloWorld/AppDelegate.m. After replacing, remember to update the moduleName from HelloWorld to whatever is there in your app.json
  2. Replace your 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 the if condition here instead of going to the else condition where it runs into the error.

@hramos hramos added Impact: Release Blocking Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. labels Feb 15, 2019
@hramos
Copy link
Contributor

hramos commented Feb 15, 2019

Thanks for reporting this, I've flagged this as something we should address before 0.59 hits stable.

facebook-github-bot pushed a commit that referenced this issue Feb 15, 2019
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:
* Chrome debugger is enabled in previous app run, then we launch the app again
* The bridge starts, then immediately reloads itself to connect to Chrome
* On the 2nd setup, the logic to update the green loading bar, with the % indicator for loading off metro, failed to find the DevLoadingView module instance because the bridge is in the middle of invalidating

See #23235

To test:
Using react-native init from github, do the steps in #23235, no more redbox. Note that the loading indicator % won't be proper still, but at least it doesn't crash/redbox.

Reviewed By: JoshuaGross

Differential Revision: D14110814

fbshipit-source-id: 835061e50acc6968bffbcc2ddfbe8da79a100df9
@fkgozali
Copy link
Contributor

This should be fixed with this commit: a9dd828 -- will be picked to the RC branches

grabbou pushed a commit that referenced this issue Feb 18, 2019
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:
* Chrome debugger is enabled in previous app run, then we launch the app again
* The bridge starts, then immediately reloads itself to connect to Chrome
* On the 2nd setup, the logic to update the green loading bar, with the % indicator for loading off metro, failed to find the DevLoadingView module instance because the bridge is in the middle of invalidating

See #23235

To test:
Using react-native init from github, do the steps in #23235, no more redbox. Note that the loading indicator % won't be proper still, but at least it doesn't crash/redbox.

Reviewed By: JoshuaGross

Differential Revision: D14110814

fbshipit-source-id: 835061e50acc6968bffbcc2ddfbe8da79a100df9
grabbou pushed a commit that referenced this issue Feb 18, 2019
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:
* Chrome debugger is enabled in previous app run, then we launch the app again
* The bridge starts, then immediately reloads itself to connect to Chrome
* On the 2nd setup, the logic to update the green loading bar, with the % indicator for loading off metro, failed to find the DevLoadingView module instance because the bridge is in the middle of invalidating

See #23235

To test:
Using react-native init from github, do the steps in #23235, no more redbox. Note that the loading indicator % won't be proper still, but at least it doesn't crash/redbox.

Reviewed By: JoshuaGross

Differential Revision: D14110814

fbshipit-source-id: 835061e50acc6968bffbcc2ddfbe8da79a100df9
@fkgozali
Copy link
Contributor

Closing this issue. Please re-open as needed.

ericlewis pushed a commit to ericlewis/react-native that referenced this issue Feb 20, 2019
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:
* Chrome debugger is enabled in previous app run, then we launch the app again
* The bridge starts, then immediately reloads itself to connect to Chrome
* On the 2nd setup, the logic to update the green loading bar, with the % indicator for loading off metro, failed to find the DevLoadingView module instance because the bridge is in the middle of invalidating

See facebook#23235

To test:
Using react-native init from github, do the steps in facebook#23235, no more redbox. Note that the loading indicator % won't be proper still, but at least it doesn't crash/redbox.

Reviewed By: JoshuaGross

Differential Revision: D14110814

fbshipit-source-id: 835061e50acc6968bffbcc2ddfbe8da79a100df9
@EskelCz
Copy link

EskelCz commented May 7, 2019

@fkgozali I'm still seeing this issue on real device (ios), with react native 0.59.3.
It must be something else going on.

@olegdater
Copy link

@karanjthakkar fix worked for me like a miracle

@izadmehr
Copy link

I still have the same issue on react-native 0.59.8. I tried Erase All Content and Settings and no success. In remote JS debugging mode if I reload the app, the app throws the error.

t-nanava pushed a commit to microsoft/react-native-macos that referenced this issue Jun 17, 2019
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:
* Chrome debugger is enabled in previous app run, then we launch the app again
* The bridge starts, then immediately reloads itself to connect to Chrome
* On the 2nd setup, the logic to update the green loading bar, with the % indicator for loading off metro, failed to find the DevLoadingView module instance because the bridge is in the middle of invalidating

See facebook#23235

To test:
Using react-native init from github, do the steps in facebook#23235, no more redbox. Note that the loading indicator % won't be proper still, but at least it doesn't crash/redbox.

Reviewed By: JoshuaGross

Differential Revision: D14110814

fbshipit-source-id: 835061e50acc6968bffbcc2ddfbe8da79a100df9
@badbod99
Copy link

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.

@kg-currenxie
Copy link

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.

Same, 0.59.9, iOS simulator with debugging + hot reload ON

@sapjax
Copy link

sapjax commented Jul 22, 2019

0.59.10 still have this problem.

@vanyasem
Copy link

Still seeing it on 0.60.4

@adanmayer
Copy link

Same here on 0.60.4.

@erdemildiz
Copy link

+1 Same error on 0.60.4

@jake-tobin
Copy link

still getting this error after updating and resetting device as well.

does anyone know if this problem will effect the delivered app after development? or is it only when building on computer?

@janczizikow
Copy link

First time encountered this after upgrading from 0.59.10 to 0.60.4. In my case it happens when I try to refresh ( + R) iOS simulator.

@dongcaiying
Copy link

"Reload", than its ok

@janczizikow
Copy link

@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.

@facebook facebook locked as resolved and limited conversation to collaborators Feb 19, 2020
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Feb 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Issue: Author Provided Repro This issue can be reproduced in Snack or an attached project. Platform: iOS iOS applications. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests