microsoft / react-native-macos

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

ERROR: No bundle URL present. #2108

Open neko3cs opened 3 months ago

neko3cs commented 3 months ago

Environment

react-native -v:12.3.6(npx)
npm ls react-native-macos:react-native-macos@0.73.24
node -v:v21.7.2
npm -v:10.5.0
yarn --version:1.22.22
xcodebuild -version:Xcode 15.3 Build version 15E204a

Steps to reproduce the bug

Do this getting started. https://microsoft.github.io/react-native-windows/docs/rnm-getting-started

Before npx react-native run-macos, you should run cd macos && pod install. I cannot run app without this step.

Expected Behavior

Launch application and show ui same as iOS.

Actual Behavior

image

Reproducible Demo

src.zip

Full size is over 25MB. So this is a sample deleted this:

Additional context

I tryed what this comment telling, but I cannot launch app. https://github.com/microsoft/react-native-macos/issues/400#issuecomment-632348718

First, --use-react-native-macos has occured not found error. error messeage: error: unknown option '--use-react-native-macos'

So I removed 👆 option and run this: node node_modules/react-native-macos/local-cli/cli.js bundle --entry-file index.js --platform macos --bundle-output MyApp.jsbundle But same error has occured.

Saadnajmi commented 2 months ago

Yeah that option is deprecated / removed so we should update the docs. Does your app work if you run a metro server locally (I.e run 'npx react-native start' from a terminal while the app is running)?

neko3cs commented 2 months ago

@Saadnajmi I'm sorry for late message. iOS App is work. but macOS App is not work. To begin with, when I run npx react-native start, I don't see the macOS startup options. Only "reload the app", "open developer menu", "run on iOS", "run on Android".

Saadnajmi commented 2 months ago

@neko3cs The macOS startup options won't show, but if you click "Reload" in the Redbox, it should still properly reload the bundle

neko3cs commented 2 months ago

@Saadnajmi I think We have difference in perception. The image of section "Actual Behavior" is what running "npx react-native run-macos", not "npx react-native start". Both of that commands behave differently.

react-native-macos-error

bear-ei commented 2 months ago

@Saadnajmi I think We have difference in perception. The image of section "Actual Behavior" is what running "npx react-native run-macos", not "npx react-native start". Both of that commands behave differently.

Currently, executing npx react-native run-macos in version 0.73.0 does indeed result in the issue of "No bundle URL present." However, you can first run npx react-native start in one terminal to manually start the local Metro server, and then execute npx react-native run-macos to start the macOS application.

Saadnajmi commented 2 months ago

@bear-ai Thanks, yes I think run-macos is broken atm, I want to replace it with https://github.com/react-native-community/cli/tree/main/packages/cli-platform-apple , perhaps with the 0.74 release. I'm glad we found a workaround!

neko3cs commented 2 months ago

Yeeeeeaaaaaah!!! I'm happy to lauch my app! @Saadnajmi @bear-ei Thank you so much for your helping! I ran metro server on background(npx react-native start on other terminal), and I ran npx react-native run-macos. So app is launched.

I hope to fix this problem. Is this a Metro server issue? Should I open an Issue in the Repository?

Saadnajmi commented 2 months ago

No, I think it's still an issue with our repo

neko3cs commented 2 months ago

Oh, I understand. So "perhaps with the 0.74 release." you say. I looking forward to release it.

michelcrypt4d4mus commented 1 month ago

also having this issue