microsoft / react-native-macos

A framework for building native macOS apps with React.
https://microsoft.github.io/react-native-windows/
MIT License
3.56k stars 137 forks source link

Bundling loader stuck forever on screen #2210

Open George3d6 opened 1 month ago

George3d6 commented 1 month ago

Environment

react-native -v: 14.1.0
npm ls react-native-macos:  react-native-macos@0.75.5
node -v: v20.13.1
npm -v: 10.5.2
yarn --version: 3.6.4
xcodebuild -version: Xcode 15.4 Build version 15F31d

Steps to reproduce the bug

  1. Run metro watchman with npx react-native start --reset-cache
  2. Build with npx react-native run-macos
  3. Sometimes happens randomly, usually related to many reloads + app stuck + needs for quite

Expected Behavior

I kill the npx react-native start --reset-cache process and the app itself I can reload metro and rebuild

Actual Behavior

My app launches but a "Bundling" loader is forever stuck on it.

The app builds, I even see it in the background with cached state loaded and it makes requests to the server but a "Bundling 98%" load blocks me from interacting with it.

Reproducible Demo

No response

Additional context

This might be a case of "small convenience feature actually kills dev experience"

The way to fix this bug seems to be to have the "build" window in the background such that the "Bundling" loader never appears -- It's unrelated to the app working

Saadnajmi commented 1 month ago

You're stuck at 98%, not 100%? AKA, this is not a duplicate of https://github.com/microsoft/react-native-macos/issues/2183 ?

bear-ei commented 1 month ago

Am having the same problem with react-native-macos@0.75.6. But I'm stuck at 100%.

Saadnajmi commented 1 month ago

I think with 0.74+ the loading screen has been buggy, so I would call this method somewhere in your App / AppDelegate to disable:

RCTDevLoadingViewSetEnabled(NO);

kaiyes commented 1 month ago

in 75.6, I also get stuck on a 100% loading screen.

Went inside react-native-macos folder in node modules to see if it had your fix.

Looks like it does.

Still getting the 100% loading.

However, I'm also getting this image library related error too

Screenshot 2024-10-03 at 12 04 30 AM Screenshot 2024-10-03 at 12 09 33 AM Screenshot 2024-10-03 at 12 08 10 AM Screenshot 2024-10-03 at 12 08 25 AM
kaiyes commented 1 month ago

Shoot. Solved by restarting metro !

Sorry ! No need to add RCTDevLoadingViewSetEnabled(NO);

Saadnajmi commented 1 month ago

Could y'all try applying https://github.com/microsoft/react-native-macos/pull/2211 locally (just copy and paste the changes in your Xcode project) and tell me if this works?