question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Building JavaScript bundle often gets stuck at 0%

See original GitHub issue

Description

When the Expo app starts and I click on my project, 1 out of every 3-4 times it gets stuck. This also happens with the same frequency when I have live reloading enabled and save my changes. The text at the bottom of the screen says “Building JavaScript Bundle…” and to the right is written 0.00%. When this happens, I have to restart the project from Expo XDE and shut down the app on my phone and restart it for it to work again.

Expected Behavior

When I reload the app after changing code, or when I start it up, it should finish building the javascript bundle and start my app.

Observed Behavior

The loading indicator gets stuck at 0%.

If there’s an error message, please paste the full terminal output and error message in this code block:

No error message. I can’t even shake the phone so I can get the developer tools.

Environment

Please run these commands in the project folder and fill in their results:

  • npm ls react-native-scripts: It says empty.

  • npm ls react-native:

UNMET DEPENDENCY react-native@https://github.com/expo/react-native/archive/sdk-23.0.1.tar.gz 

npm ERR! missing: react-native@https://github.com/expo/react-native/archive/sdk-23.0.1.tar.gz, required by MYAPPNAME@0.1.0
npm ERR! extraneous: react-native@https://github.com/expo/react-native/archive/sdk-23.0.1.tar.gz FOLDERPATH/app/node_modules/react-native
  • npm ls expo:
UNMET DEPENDENCY expo@23.0.6 

npm ERR! missing: expo@23.0.6, required by MYAPPNAME@0.1.0
npm ERR! extraneous: expo@23.0.6 FOLDERPATH/app/node_modules/expo
  • node -v: v8.7.0
  • npm -v: 5.5.1
  • yarn --version: 1.3.2
  • watchman version: 4.9.0

Also specify:

  1. Operating system: MacOS High Sierra 10.13.1
  2. Phone/emulator/simulator & version: iPhone 6s

Here’s my package.json if that’s of any help.

{
  "name": "MYAPPNAME",
  "version": "0.1.0",
  "private": true,
  "devDependencies": {
    "babel-cli": "^6.26.0",
    "babel-jest": "^21.2.0",
    "babel-plugin-transform-react-jsx-source": "^6.22.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-react-native": "^4.0.0",
    "enzyme": "^3.2.0",
    "jest": "^21.2.1",
    "jest-expo": "^24.0.0",
    "prettier": "^1.7.4",
    "prettier-eslint": "^8.2.1",
    "react-native-scripts": "1.3.1",
    "react-test-renderer": "^16.0.0"
  },
  "main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
  "scripts": {
    "start": "react-native-scripts start",
    "eject": "react-native-scripts eject",
    "android": "react-native-scripts android",
    "ios": "react-native-scripts ios",
    "test": "jest"
  },
  "jest": {
    "preset": "jest-expo",
    "testPathIgnorePatterns": [
      "/node_modules/"
    ]
  },
  "dependencies": {
    "axios": "^0.16.2",
    "expo": "^24.0.0",
    "firebase": "^4.5.1",
    "lodash": "^4.17.4",
    "moment": "^2.19.1",
    "prop-types": "^15.6.0",
    "react": "16.0.0",
    "react-native": "https://github.com/expo/react-native/archive/sdk-24.0.0.tar.gz",
    "react-native-autocomplete-input": "^3.4.0",
    "react-native-azure-ad": "^0.2.4",
    "react-native-img-cache": "^1.5.3",
    "react-native-router-flux": "^4.0.0-beta.21",
    "react-native-slider": "^0.11.0",
    "react-redux": "^5.0.6",
    "redux": "^3.7.2",
    "redux-thunk": "^2.2.0",
    "watchman": "^1.0.0"
  }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

12reactions
floriancargoetcommented, Mar 7, 2018

Just got this issue, I can’t build my JS bundle anymore. Deleting node_modules & package-lock.json did not help.

Edit: This stack overflow answer helped: https://stackoverflow.com/a/45477185/4829109 => Delete the content of /usr/local/var/run/watchman/

0reactions
bogomyacommented, Jul 3, 2018

There are some problems with watchman. But running watchman --foreground in a separate terminal solved the issue with stucked build for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building JavaScript bundle often gets stuck at 0% #513 - GitHub
When the Expo app starts and I click on my project, 1 out of every 3-4 times it gets stuck. This also happens...
Read more >
building javascript bundle: 0% - react native - Stack Overflow
When i run the command "npm start", the expo developer tool gets open and the tunnel gets connected but the javascript bundle gets...
Read more >
Troubleshooting Common Errors - Gatsby
If you encounter a webpack error that says Generating SSR bundle failed after installing a plugin and trying to run gatsby develop or...
Read more >
Handling common JavaScript problems - MDN Web Docs
After the packages have finished installing, try loading up a JavaScript file: you'll see any issues highlighted with green (for warnings) and ...
Read more >
react native downloading javascript bundle 100% stuck-Reactjs
[Solved]-react native downloading javascript bundle 100% stuck-Reactjs · Go to settings in mobile >> Installed Apps >> choose your app and click on...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found