-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Bundles generated offline do not start running the RN app when executed (white screen on version 0.69+) #10255
Comments
Solved it by downgrading react-native to 0.67 |
The link to base64string-package-maker doesn't work, is it a private repo? Through validating the publish of React Native Gallery on 0.69 we know that bundling for C++ in release is good. |
I hade downgraded to 0.67.4 and it is working now so the repo work now and I changed it private. The repo I create is So as long as you create one and publish it with a release, I am sure that you will get the same problem. The only libraries I hade on top of react-native and react-native-windows are the following
|
I can repro this on 0.69. The bundle file is present in the appx package, investigating to see why it isn't loading when the app starts. |
Confirmed that the bundle is seen and loaded from disk, still investigating. |
Confirmed that this repros with new 69 C++ apps in release mode too. |
Confirmed this issue does not repro in RNW 0.68.9. This only repros in RNW 0.69. |
Still actively investigating this, spent all day Friday trying to debug what's going on. So far:
However, the JS app doesn't start. As far as I can see, no messages are ever sent across the bridge, view managers never create any views, etc. Without any errors, you're left with an empty ReactRootControl and the JS code is "done". This repros in debug with a local bundle (so it's not just release). It repros with both chakra and hermes. It repros with both The only remaining lead is that it doesn't repro with the E2ETestApp, which loads a modified version of RNTesterApp. Which is double frustrating because the E2E tests actually interact with the UI, so if the issue did repro, the tests would have failed and caught this. |
I have confirmed via experiment that copying and using the "new RN app template" JS within the e2e test app source repros the behavior - loading bundle via metro works, loading offline bundle gives a blank app. |
…undles synchronously `JsToNativeBridge::callNativeModules` only calls the stored `BridgeUIBatchInstanceCallback::onBatchComplete` if it's at the end of a batch, and either a native/turbo module method had been called previously, or if there are new incoming method calls. This call to `onBatchComplete` is what causes the batched UI queue to be processed, rendering changes in the native UI. However, some (simple) JS apps, such as the default template for a new RN app, don't make any native function calls during app startup. When loading bundles asynchronously from Metro, the `onBatchComplete` call to process the UI queue gets posted to the native queue, so it gets run appropriately. However, when loading bundles synchronously (from a pre-built bundle file), the first `onBatchComplete` will only be called if a native/turbo module was called during app startup. Without it, the app is *technically running*, but batched UI queue just sits there with the tasks to build the initial UI unprocessed. The result is a "blank app", i.e. the `ReactRootView` has no children. "Technically" the app has loaded and is running (if you click we'll dispatch events to the JS side). This PR fixes the issue by explictly calling the `onBatchComplete` after the app has loaded from a synchronous bundle load. If the batch has already been processed, then it's essentially a slightly wasteful no-op. I have tested that this resolves the issue for the "simple" apps, and seems to have no adverse effect on apps that have already caused `onBatchComplete` to be called normally. Resolves microsoft#10255
The bug is that the commands to render the UI don't get processed on the native side if no native modules are ever called by the JS. |
the same problem, any update or any way to a workaround for this? |
Hi @jonthysell , |
I'm still encountering this on 0.69.6, where I believe the fix was published. Weirdly, when I build a package in Visual Studio the bug does not occur. This is still a blocker however, as it prevent our CI deployment. |
This was only recently backported to 0.69. You're going to need something newer. The build published next week should have it (0.69.7). |
I'm facing this blank white window error. Can anyone help me please? |
Problem Description
I have build an app
base64string-package-maker
to be able to decrypt packages so that I could use the package on other apps.The problem is that When I build
publish/create app Package
withrelease
as a target I only get blank app.That mean when I run
Install.ps1
the app gets installed but there is no js included what so ever.I think that the app boundle is not included somehow or maybe something else.
I do not get Any exception or error, So I have no Idea what is happning.
Steps To Reproduce
1- create an app and then publish it with release
2- You will get a clean app without any js
OR
1- fork my app base64string-package-maker
2- publish it and see that there is no js included
Expected Results
The app should show the js components and run as normal.
CLI version
8.0.3
Environment
Target Platform Version
10.0.15063
Target Device(s)
Desktop
Visual Studio Version
Visual Studio 2019
Build Configuration
Release
Snack, code example, screenshot, or link to a repository
base64string-package-maker
The text was updated successfully, but these errors were encountered: