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

Unable to open Expo menu after failing to connect to debugger #11598

Closed
jojenki opened this issue Jan 11, 2021 · 19 comments
Closed

Unable to open Expo menu after failing to connect to debugger #11598

jojenki opened this issue Jan 11, 2021 · 19 comments

Comments

@jojenki
Copy link

jojenki commented Jan 11, 2021

I've never setup a debugger for my app when running on my Android device (tried and can't figure it out). That's acceptable for now, since I've just been using Android for look-and-feel. Today, I opened the Expo menu within my app and accidentally clicked "Debug Remote JS". Of course, this always fails because I don't have a debugger setup.

Now, whenever I open my app on my Android device it gives me the failure screen with the big red bar at the top saying "Failed to connect to debugger!". The only options I have are "DISMISS" and "RELOAD". If I RELOAD, it kills the app and restarts it, and takes me back to the "Failed to connect to debugger!" page. If I DISMISS, it closes the warning page and then just hangs on the app loading screen. It never actually loads the app.

The most frustrating part (and the real bug here) is that I can't bring up the context menu to tell it to stop trying to connect a debugger or tell Expo to forget my settings for this app. Expo effectively locks me out of the app because of the failure to connect to the debugger. The only "fix" I've found for this is to go into Android's Settings and Clear Cache and Clear Storage for the Expo app, which also logs me out. Instead, the Expo app should let me change the settings like connecting to the debugger before I actually launch the app.

@jojenki jojenki changed the title Unable to open Expo menu after connecting to debugger Unable to open Expo menu after failing to connect to debugger Jan 11, 2021
@brentvatne
Copy link
Member

Of course, this always fails because I don't have a debugger setup.

this shouldn't be the case - it should open up chrome to start the debugger.

The most frustrating part (and the real bug here) is that I can't bring up the context menu to tell it to stop trying to connect a debugger or tell Expo to forget my settings for this app.

yeah that's very annoying, sorry about that

@jojenki
Copy link
Author

jojenki commented Jan 12, 2021

Thanks for the quick response. Where should it open the Chrome window, on the Android device where the app is being launched or on my desktop where I'm doing development? Maybe I need to already have a Chrome window open on my desktop? (My default browser is actually Firefox.) I'll take another pass through the setup. Thanks!

@chuanxie
Copy link

i would say sdk 40 is the worst upgrade of expo.
so many things stop working

@jojenki
Copy link
Author

jojenki commented Jan 14, 2021

Well, if this is the worst upgrade, then the product is in a pretty great state. This is my first experience with it, and I am extremely pleased.

@brentvatne
Copy link
Member

@chuanxie - that is strange, because we didn't update the react-native version and most of the changes were bug fixes and feature improvements. perhaps there are some other underlying issues in your app? if you want to share your app with me on github i can investigate. i strongly suspect it's not actually related to anything we did

@brentvatne
Copy link
Member

Thanks for the quick response. Where should it open the Chrome window, on the Android device where the app is being launched or on my desktop where I'm doing development? Maybe I need to already have a Chrome window open on my desktop? (My default browser is actually Firefox.) I'll take another pass through the setup. Thanks!

it would open chrome on your computer (or i believe it will fall back to firefox if you use that by default, but i am not entirely sure).

@chuanxie
Copy link

chuanxie commented Jan 14, 2021

@brentvatne. i created a branch for sdk40 upgrade and react native debugger stopped working (waiting for react to connect), deleted yarn lock and node_modules, checkout the sdk39 and ran yarn install. react native debugger starts working again.
i even tested with react native debugger with brand new expo init and same issue with react native debugger. https://github.com/chuanxie/sdk40
tested with RN debugger version : 0.11.6 & 0.11.17
but if i use default debugger , app can be loaded but come with
Unable to resolve module ./debugger-ui/debuggerWorker`

DevTools failed to load SourceMap: Could not load content for http://localhost:19000/debugger-ui/debuggerWorker.aca173c4.js.map: Fetch through target failed: Target not supported; Fallback: HTTP error: status code 500, net::ERR_HTTP_RESPONSE_CODE_FAILURE

@brentvatne
Copy link
Member

we lean on react-native's built in debugging, and so any problems that occur there also occur in expo projects. sadly this is an upstream react-native issue: facebook/react-native#28844

we have already worked on a fix for one of the possible causes (related to caching), @satya164 released a fix for it here: react-native-community/cli#1307

he has also encountered a similar issue to what you mentioned above, and he said that it's just a warning and debugging continues to work. he is investigating it though.

@jojenki
Copy link
Author

jojenki commented Jan 14, 2021

Ah, the upstream issue seems to be the same issue that I've always experienced (as a new user). I've never been able to get debugging working on a device, emulator, or web, and I suspect that's the root cause. I've subscribed to it, so this issue can either track that one or be closed in lieu of it, as far as I'm concerned. Thanks!

@chuanxie
Copy link

@brentvatne
RN debugger problem solved after running brew upgrade like python and also watchman
maybe need to notice those dependencies for the future expo updates

@github-actions
Copy link
Contributor

github-actions bot commented Feb 3, 2022

This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the stale label Feb 3, 2022
@github-actions
Copy link
Contributor

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

@AlanSl
Copy link

AlanSl commented Jun 21, 2022

The most frustrating part (and the real bug here) is that I can't bring up the context menu to tell it to stop trying to connect a debugger or tell Expo to forget my settings for this app.

yeah that's very annoying, sorry about that

@brentvatne This seems to still happen, so I don't think this issue should be closed.

I just did exactly the same thing as the original question: I accidentally turned on remote debugging on an app where I don't expect remote debugging to work (in my case it uses turbomodules / reanimated); and now I'm stuck because Expo has remembered my "preference", there's no way to change it outside of the developer shake-menu of the app (that I can see), but the app instantly crashes with this error before I can access the developer menu to try to turn it off again.

Is there any workaround for this?

I tried tricking Expo into seeing it as a different app by changing the name and slug in app.json then clearing cache and restarting, but it still saw it as the same app and still applied the same unremovable instant-crash preference.

(Longer-term, it'd be nice if there was an option in Expo app settings, or if you could access the developer menu of an app before opening it by long-pressing it in the Expo list)

@anti-duhring
Copy link

anti-duhring commented Jul 1, 2022

I just did exactly the same thing as the original question: I accidentally turned on remote debugging on an app where I don't expect remote debugging to work (in my case it uses turbomodules / reanimated); and now I'm stuck because Expo has remembered my "preference", there's no way to change it outside of the developer shake-menu of the app (that I can see), but the app instantly crashes with this error before I can access the developer menu to try to turn it off again.

Got the same error here... The solution that I found was to uninstall the app in my device and then run the build again. The menu showed like was my first time running the app and I was able to turn local dev tools off once again.

@jpschw
Copy link

jpschw commented Jul 3, 2022

We couldn't access our application anymore in the Android simulator because of this bug. There is no way to bring up the menu after the error has occurred. Reinstalling Expo Go on the device resolves the issue.

@DmitriyOpletaev
Copy link

I also faced this, it's terrible. Can you fix it?

@audoh
Copy link

audoh commented Sep 1, 2022

Issue still seems to be present, tried getting the debugger to work as an alternative to reinstalling the app but no luck.

Edit seems like the issue is a result of running the expo server in a Docker container, since it obviously can't open a Chrome tab. I can manually navigate to http://localhost:19000/debugger-ui/ and get the debugger working.

Still, it doesn't seem like debugger connection failure should break the whole app.

@admehta01
Copy link

Happening for me too, only workaround is to uninstall and re-install my development build.

@soulfresh
Copy link

Same issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants