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

[SDK 45.0.1][expo-dev-client] No reconnect to Metro possible, blank screen after reload #17389

Closed
hirbod opened this issue May 7, 2022 · 6 comments
Assignees
Labels
Development Builds incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues

Comments

@hirbod
Copy link
Contributor

hirbod commented May 7, 2022

Summary

SDK 45.0.1 and expo-dev-client 0.9.5 handled all the long lasting DX issues and crashes. Thanks a ton.
After upgrading, I found a small issue, which is a bit annoying:

  1. Open your app with dev-client
  2. Select your server to load your bundle
  3. Use your app
  4. Background your app
  5. Wait 2 or 3 minutes (keep app backgrounded)
  6. CLI will output
Cannot connect to Metro.

Try the following to fix the issue:
- Ensure that Metro is running and available on the same network
- Ensure that the Metro URL is correctly set in AppDelegate
  1. This is expected, since the OS killed the Socket connection.
  2. Open developer menu and hit "reload"
  3. App will be blank and white

I am not sure why expo-dev-client can't reconnect to Metro in first place. I am also handling WebSockets in my App which can recover after a day. It looks like there is no real integrated mechanism to try to reconnect to the running CLI instance.

I can just restart the App and everything is fine, but doing so I always lose my current state and can't test backgrounded scenarios correctly, because Metro connection is lost.

Managed or bare workflow? If you have made manual changes inside of the ios/ or android/ directories in your project, the answer is bare!

bare

What platform(s) does this occur on?

iOS

Package versions

0.9.5

Environment

  expo-env-info 1.0.3 environment info:
    System:
      OS: macOS 12.3.1
      Shell: 5.8 - /bin/zsh
    Binaries:
      Node: 14.19.1 - /usr/local/opt/node@14/bin/node
      Yarn: 1.22.17 - /usr/local/bin/yarn
      npm: 6.14.16 - /usr/local/opt/node@14/bin/npm
    Managers:
      CocoaPods: 1.11.2 - /usr/local/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
    IDEs:
      Android Studio: 4.1 AI-201.8743.12.41.6953283
      Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild
    npmGlobalPackages:
      eas-cli: 0.51.0
      expo-cli: 5.4.3
    Expo Workflow: bare

Reproducible demo

None. Grab any with current dev-client and follow my steps.

Stacktrace (if a crash is involved)

No response

@hirbod hirbod added the needs validation Issue needs to be validated label May 7, 2022
@raajnadar
Copy link
Contributor

I think this is similar bug report? #17089

@hirbod
Copy link
Contributor Author

hirbod commented May 8, 2022

Might be related, indeed

@evelant
Copy link

evelant commented May 10, 2022

I think there may be deeper issues here possibly related to #17355. Do you see two "android bundling complete" when pressing r to reload like so?

› Reloading apps
Android Bundling complete 116ms
Android Bundling complete 121ms

I'm also seeing that updated code is not loaded on the first reload, it takes 2 reloads.

@ajsmth ajsmth self-assigned this May 10, 2022
@tcdavis tcdavis added needs repro and removed needs validation Issue needs to be validated labels Jun 15, 2022
@tcdavis
Copy link
Contributor

tcdavis commented Jun 15, 2022

We've spent some time investigating this and haven't been able to reproduce what you're experiencing. If someone can take the time to put together a reliable repro case we can investigate further

@brentvatne brentvatne added the incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues label Jun 28, 2022
@expo-bot
Copy link
Collaborator

Hi there! It looks like your issue requires a minimal reproducible example, but it is invalid or absent. Please prepare such an example and share it in a new issue.

The best way to get attention to your issue is to provide a clean and easy way for a developer to reproduce the issue on their own machine. Please do not provide your entire project, or a project with more code than is necessary to reproduce the issue.

A side benefit of going through the process of narrowing down the minimal amount of code needed to reproduce the issue is that you may get lucky and discover that the bug is due to a mistake in your application code that you can quickly fix on your own.

Resources

Common concerns

"I've only been able to reproduce it in private, proprietary code"

You may not have spent enough time narrowing down the root cause of the issue. Try out the techniques discussed in this manual debugging guide to learn how to isolate the problem from the rest of your codebase.

"I didn't have time to create one"

That's understandable, it can take some time to prepare. We ask that you hold off on filing an issue until you are able to fully complete the required fields in the issue template.

"You can reproduce it by yourself by creating a project and following these steps"

This is useful knowledge, but it's still valuable to have the resulting project that is produced from running the steps, where you have verified you can reproduce the issue.

@hirbod
Copy link
Contributor Author

hirbod commented Jun 30, 2022

Several thumbs up but still got closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development Builds incomplete issue: missing or invalid repro A minimal reproducible example is required for most issues
Projects
None yet
Development

No branches or pull requests

8 participants