Skip to content
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

"run-android" stuck on JS Metro Bundler ("warn") #25904

Closed
ezranbayantemur opened this issue Aug 1, 2019 · 31 comments · Fixed by react-native-community/cli#604
Closed

"run-android" stuck on JS Metro Bundler ("warn") #25904

ezranbayantemur opened this issue Aug 1, 2019 · 31 comments · Fixed by react-native-community/cli#604
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.

Comments

@ezranbayantemur
Copy link

ezranbayantemur commented Aug 1, 2019

Today I created a new project with "react-native init projectName" and when I tried to "run-android" it runs Node JS server and stucks like first screenshot.

If I kill the JS server it gives the warn about packager server and contiunes to install app and gives Unable to load script error (for sure because JS server not running)

When I first type "react-native start" and "run-android" it works fine, but I want to know why it happens like that? I search that warn error and can't find anything.

It's start happening suddenly. I didn't recieve that error on my old projects (same react and react native versions) and don't know why it happens.

Any help?

1
2

Error:

warn Failed to automatically start the packager server. Please run "react-native start" manually. Error details: Command failed: cmd.exe /C C:\Users\ezran\Desktop\SADELABS\demoProject\node_modules\react-native\scripts\launchPackager.bat
nullnull

package.json

"react": "16.8.6", "react-native": "0.60.4"

System:
    OS: Windows 10
    CPU: (8) x64 Intel(R) Core(TM) i5-8250U CPU @ 1.60GHz
    Memory: 2.63 GB / 7.88 GB
  Binaries:
    Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
    npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
  IDEs:
    Android Studio: Version  3.4.0.0 AI-183.6156.11.34.5692245
@react-native-bot react-native-bot added Platform: Android Android applications. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used. labels Aug 1, 2019
@react-native-bot
Copy link
Collaborator

Can you run react-native info and edit your issue to include these results under the React Native version: section?

If you believe this information is irrelevant to the reported issue, you may write `[skip envinfo]` alongside an explanation in your Environment: section.

@ezranbayantemur
Copy link
Author

Can you run react-native info and edit your issue to include these results under the React Native version: section?

If you believe this information is irrelevant to the reported issue, you may write [skip envinfo] alongside an explanation in your Environment: section.

I updated

@ghost
Copy link

ghost commented Aug 1, 2019

Same problem, I tried to reinstall node, clear npm cache, etc ...

@rabingithb
Copy link

Same problem, how to solve the issue?

@RoxaneGall
Copy link

Same problem too ! (tried to reinstall node, used yarn or npm, cleared cache and so on)

@meowcorp
Copy link

meowcorp commented Aug 1, 2019

Same problem too, please help

@ipr0310
Copy link

ipr0310 commented Aug 1, 2019

I am also having this issue too!

"dependencies": { "react": "16.8.6", "react-native": "0.60.4" }

System: OS: Windows 10
CPU: (12) x64 AMD Ryzen 5 1600 Six-Core Processor
Memory: 5.95 GB / 15.95 GB
Binaries:
Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
IDEs: Android Studio: Version 3.4.0.0 AI-183.6156.11.34.5692245

and i have made the refactor to AndroidX and use JETIFIER

and it does not even compile my app on an Android Emulator, it just get stuck in the metro bundler, like the image for example.

I recently upgraded to react native 0.60.4 using this tool

https://react-native-community.github.io/upgrade-helper/?from=0.59.8&to=0.60.4

@ghost
Copy link

ghost commented Aug 1, 2019

Same problem

@GaateKeeper
Copy link

similar issue here as well

@thecodrr
Copy link
Contributor

thecodrr commented Aug 1, 2019

@ezranbayantemur This seems to be an issue with the CLI. I suggest you open an issue there.

@ezranbayantemur
Copy link
Author

@ezranbayantemur This seems to be an issue with the CLI. I suggest you open an issue there.

But same (version) CLI runs older projects (just created a week ago, not different) perfectly. I don’t think problem about CLI.

@thecodrr
Copy link
Contributor

thecodrr commented Aug 1, 2019

@ezranbayantemur what's your CLI version? Check using yarn list @react-native-community/cli.

@san003
Copy link

san003 commented Aug 2, 2019

same problem,Please help me

@ParthShrivastav
Copy link

Same here

@thecodrr
Copy link
Contributor

thecodrr commented Aug 2, 2019

This was an issue with the CLI. Fixed in #604. Please wait for the new CLI release (happens quickly) and then update.

As a workground, just downgrade your CLI to 2.8.0 or lesser and it will work without an issue. Upgrade/Downgrade instructions here

@san003
Copy link

san003 commented Aug 2, 2019

When I init my project at react-native version 0.59.3 again. The problem is gone.

@rabingithb
Copy link

rabingithb commented Aug 2, 2019

i have got the solution of the problem

  1. go to your project and run 2 command shell
  2. in first shell, run npm start
  3. in second shell, react-native run-android
    then it will run

@thecodrr
Copy link
Contributor

thecodrr commented Aug 2, 2019

@san003 RN versions less than 0.60 use 1.0+ versions of CLI which don't have the bug. RN Version 0.60+ uses 2.0+ version of CLI.

@ezranbayantemur
Copy link
Author

ezranbayantemur commented Aug 2, 2019

@ezranbayantemur what's your CLI version? Check using yarn list @react-native-community/cli.

When I was command "react native -v"

react-native-cli: 2.0.1 react-native: 0.60.4

If CLI is the problem how can work on older project? I mean it can be, maybe I was wrong, CLI has problem, but I don't get it. I have two project which one of them created one week ago (0.60.4), one of them yesterday (0.60.4), older one works fine but the other has a problem.

@thecodrr
Copy link
Contributor

thecodrr commented Aug 2, 2019

@ezranbayantemur that's the global-cli version. Run the command i gave you.

@thecodrr
Copy link
Contributor

thecodrr commented Aug 2, 2019

If CLI is the problem how can work on older project? I mean it can be, maybe I was wrong, CLI has problem, but I don't get it. I have two project which one of them created one week ago (0.60.4), one of them yesterday (0.60.4), older one works fine but the other has a problem.

Compare the CLI versions of both the projects using the command I gave you and you will see the difference. Each time you run react-native init, the latest CLI version is installed (locally not globally).

Edit: And I fixed it in the CLI so it is of course a problem with the CLI. Try the workaround I gave above until a new CLI release is published.

@ezranbayantemur
Copy link
Author

If CLI is the problem how can work on older project? I mean it can be, maybe I was wrong, CLI has problem, but I don't get it. I have two project which one of them created one week ago (0.60.4), one of them yesterday (0.60.4), older one works fine but the other has a problem.

Compare the CLI versions of both the projects using the command I gave you and you will see the difference. Each time you run react-native init, the latest CLI version is installed (locally not globally).

Yeah you were right, older project has "@react-native-community/cli@2.8.0", newer one " @react-native-community/cli@2.8.1".

Sorry for not thinking problem on CLI, my bad. I don't know very well CLI

@akshaykumar0291
Copy link

akshaykumar0291 commented Aug 2, 2019

Mine is started working, just I had to do one more step.

  1. npm start
  2. react-native start
  3. react-native run-android

@ezranbayantemur
Copy link
Author

This was an issue with the CLI. Fixed in #604. Please wait for the new CLI release (happens quickly) and then update.

As a workground, just downgrade your CLI to 2.8.0 or lesser and it will work without an issue. Upgrade/Downgrade instructions here

I downgrade it but still has same error.

I remove @react-native-community/cli entry on package-lock.json and npm install @react-native-community/cli@2.8.0 but still nothing changes.

Also I checked with list command and :

+-- @react-native-community/cli@2.8.0
-- react-native@0.60.4
-- @react-native-community/cli@2.8.0 deduped

@thecodrr
Copy link
Contributor

thecodrr commented Aug 2, 2019

@ezranbayantemur run npm install --dev @react-native-community/cli@2.8.0 or yarn add --dev @react-native-community/cli@2.8.0

@thymikee
Copy link
Contributor

thymikee commented Aug 2, 2019

The issue is being worked on here: react-native-community/cli#604. Should be fixed soon. Closing this one.

@thymikee thymikee closed this as completed Aug 2, 2019
@thymikee
Copy link
Contributor

thymikee commented Aug 2, 2019

Published fix in v2.8.3 of the CLI. Please update the @react-native-community/cli to the latest version.

@gustavopch
Copy link

Published fix in v2.8.3 of the CLI. Please update the @react-native-community/cli to the latest version.

Still happening here with 2.8.3. Tried to reinstall it, tried through npx, tried many times to create a project from scratch. No success. Node version: 8.13.0.

@jqtruong
Copy link

jqtruong commented Aug 20, 2019

having the same issue with 2.9.0. Someone running 2.0.1 doesn't have that problem. Any advice on how to debug this?

$ react-native info
warn The following packages use deprecated "rnpm" config that will stop working from next release:
  - react-native-maps: https://npmjs.com/package/react-native-maps
Please notify their maintainers about it. You can find more details at https://github.com/react-native-community/cli/blob/master/docs/configuration.md#migration-guide.
info Fetching system and libraries information...
System:
    OS: Linux 5.2 Arch Linux undefined
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 1.77 GB / 15.45 GB
    Shell: 5.0.7 - /bin/bash
  Binaries:
    Node: 11.15.0 - /usr/bin/node
    Yarn: 1.17.3 - /usr/bin/yarn
    npm: 6.10.3 - /usr/bin/npm
  SDKs:
    Android SDK:
      Android NDK: 20.0.5594570
  IDEs:
    Android Studio: 3.4 AI-183.6156.11.34.5692245
  npmPackages:
    react: 16.8.6 => 16.8.6 
    react-native: 0.60.4 => 0.60.4 
  npmGlobalPackages:
    react-native-cli: 2.0.1

EDIT: @rabingithb's answer worked though...

@ipr0310
Copy link

ipr0310 commented Aug 20, 2019

Well for my solution
i just installed react-native with the latest version with this command and everything works fine!

npx react-native init MyTestApp

@FaisalKhawaj
Copy link

i was facing the issue , my server used to stop, every time , but then i have changed the port and the issue has resolved now ,
npx react-native start --port=8088

@facebook facebook locked as resolved and limited conversation to collaborators Oct 5, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 5, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Platform: Android Android applications. Resolution: Locked This issue was locked by the bot. Tech: Bundler 📦 This issue is related to the bundler (Metro, Haul, etc) used.
Projects
None yet
Development

Successfully merging a pull request may close this issue.