When using React Native Desktop for Windows I'm unable to use run-windows to start my app. I get an error in the UI about being unable to load the bundle:
Error 80072f78 downloading http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=true
and the following error in the console:
error listen EADDRINUSE: address already in use :::8081. Run CLI with --verbose flag for more details.
Environment
>npx react-native --version
4.13.1
>npx react-native info
error Unrecognized command "info".
info Run "react-native --help" to see a list of all available commands.
Steps To Reproduce
- Create a new project with port 8081 being used by another application
- Attempt to run it using
npx react-native run-windows
Expected Results
For the app to load without a bundle loading error and console error about port 8081 already being in use.
Based upon this source file (lines 380 and 406) it would seem as though run-windows hardcodes the port that Metro runs on. This should ideally be configurable as I have another (legacy) app running on my machine that requires the use of this port and it's not changeable. Is there an environment variable or other way that I'm not aware of that would permit reconfiguration of run-windows to use a different port? Vanilla React Native allows you to pass the --port argument to change this. Thanks very much for any assistance you might be able to provide!
When using React Native Desktop for Windows I'm unable to use
run-windowsto start my app. I get an error in the UI about being unable to load the bundle:Error 80072f78 downloading http://localhost:8081/index.bundle?platform=windows&dev=true&hot=false&inlineSourceMap=trueand the following error in the console:
error listen EADDRINUSE: address already in use :::8081. Run CLI with --verbose flag for more details.Environment
Steps To Reproduce
npx react-native run-windowsExpected Results
For the app to load without a bundle loading error and console error about port 8081 already being in use.
Based upon this source file (lines 380 and 406) it would seem as though
run-windowshardcodes the port that Metro runs on. This should ideally be configurable as I have another (legacy) app running on my machine that requires the use of this port and it's not changeable. Is there an environment variable or other way that I'm not aware of that would permit reconfiguration ofrun-windowsto use a different port? Vanilla React Native allows you to pass the--portargument to change this. Thanks very much for any assistance you might be able to provide!