question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SDK 45 Critical dev client bug - dev client with jsEngine: "hermes" loads android app bundle twice in development

See original GitHub issue

Summary

On SDK45 beta if you use dev client and hermes then in development mode the app bundle gets loaded and run twice on the device.

This causes all sorts of havoc with development, breaking some native modules, some parts of logging, dev tooling, causing undefined behaviors, etc as well as potentially harming performance.

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

managed

What platform(s) does this occur on?

Android

SDK Version (managed workflow only)

“expo”: “~45.0.0-beta.4”,

Environment

  expo-env-info 1.0.3 environment info:
    System:
      OS: macOS 12.3.1
      Shell: 3.3.1 - /opt/homebrew/bin/fish
    Binaries:
      Node: 16.14.2 - /opt/homebrew/opt/node@16/bin/node
      Yarn: 1.22.17 - /opt/homebrew/bin/yarn
      npm: 7.18.1 - /opt/homebrew/bin/npm
      Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman
    Managers:
      CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
    SDKs:
      iOS SDK:
        Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5
    IDEs:
      Android Studio: Bumblebee 2021.1.1 Patch 3 Bumblebee 2021.1.1 Patch 3
      Xcode: 13.3.1/13E500a - /usr/bin/xcodebuild
    npmPackages:
      expo: ~45.0.0-beta.4 => 45.0.0-beta.9
      react: 17.0.2 => 17.0.2
      react-dom: 17.0.2 => 17.0.2
      react-native: 0.68.1 => 0.68.1
      react-native-web: 0.17.1 => 0.17.1
    npmGlobalPackages:
      eas-cli: 0.52.0
      expo-cli: 5.4.3
    Expo Workflow: managed

Reproducible demo

https://github.com/evelant/expo_45_android_double_load

Expo SDK 45 with dev client and jsEngine: "hermes" loads the app bundle twice at startup in Android development mode. This causes all sorts of problems in anything beyond trivial apps.

To reproduce:

eas build -p android --profile development
//connect an android device
adb install ./build-123123123.apk
yarn start
//open app on device and connect to dev server

following these steps there will be output like

Android Bundling complete 23ms
loaded App.tsx
Android Bundling complete 52ms
Android Running app on SM-G965U
rendered App
loaded App.tsx
Android Running app on SM-G965U
rendered App

The app bundle is built twice and run twice on the device.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
evelantcommented, May 5, 2022

@ajsmth It causes issues with native modules that don’t expect to be called twice from the same running app. react-native-firebase emulator support is a big one affecting us. The double load seems to cause it to somewhat randomly lose authentication with the emulator suite leading to all firestore queries throwing permission-denied. That eats up a lot of time to then force close the app and reopen it until it works.

I think it may also be causing some dev mode app crashes with reanimated.

0reactions
evelantcommented, May 10, 2022

Hmm perhaps removing the double load actually uncovered this bug where app code doesn’t get updated until 2 refreshes have happened?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Hermes Engine - Expo Documentation
A guide on configuring Hermes for both Android and iOS in an Expo project. Hermes is a JavaScript engine optimized for React Native....
Read more >
Bug listing with status RESOLVED with resolution FIXED as at ...
Cant load libsandbox.so ... no such file" status:RESOLVED resolution:FIXED ... Bug:1721 - "hermes library is in the wrong place (app-games, while it should ......
Read more >
Using Hermes in React Native - LogRocket Blog
Hermes is not just good for React Native applications, but contributes a considerable reduction in bundle size, load time, and consumption size ...
Read more >
Doing More with Expo: Using Custom Native Code - SitePen
Expo simplifies the development of RN apps by allowing developers to ... client, it downloads the application JavaScript bundle from a dev ......
Read more >
Microsoft Zero-Day Actively Exploited, Patch Forthcoming - Vulners
The bug (CVE-2020-0674) which is listed as critical in severity for IE 11, and moderate for IE 9 and IE 10, exists in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found