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.

react-native bundle never quits, metro-config implicated

See original GitHub issue

I have a react-native monorepo which no longer builds bundles. I can run in development just fine, but when I try to build a bundle like so:

react-native bundle --platform ios --entry-file index.js --dev false --bundle-output ./ios/main.jsbundle --assets-dest ./ios --sourcemap-output ./sourcemap.js

It just hangs after this:

                    Welcome to Metro!
              Fast - Scalable - Integrated


info Writing bundle output to:, ./ios/main.jsbundle
info Writing sourcemap output to:, ./sourcemap.js
info Done writing bundle output
info Done writing sourcemap output
info Copying 118 asset files
info Done copying assets

When I use why-is-node-running, I see these handles:

# TTYWRAP
/app/node_modules/metro/node_modules/debug/src/node.js:68 - 2 === fd ? process.stderr :

# SIGNALWRAP
/app/node_modules/metro/node_modules/debug/src/node.js:68 - 2 === fd ? process.stderr :

# TTYWRAP
/app/node_modules/metro-config/src/defaults/index.js:187 - reporter: new TerminalReporter(new Terminal(process.stdout))
/app/node_modules/metro-config/src/defaults/index.js:198 - return getDefaultValues(rootPath);
/app/node_modules/metro-config/src/defaults/index.js:14  - var info = gen[key](arg);
/app/node_modules/metro-config/src/defaults/index.js:36  - asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);

I don’t know that I trust the line numbers exactly, but it is super weird. metro-config 0.64.0, metro 0.64.0, RN 0.64.0-rc.3. Fails both with and without hermes. Monorepos are notorious for issues with RN, so I do suspect that, but it was working on RN 0.63 and related metro setup.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

1reaction
bcalikcommented, Sep 28, 2021

I added an env var to our CI scripts that kills Metro after a specified interval. So no, I didn’t solve it, but I stopped it.

After wasting 2 weeks on this, I solved by simply deleting yarn.lock file and then fresh install with yarn install.

(┛ಠ_ಠ)┛彡┻━┻

0reactions
maxammanncommented, Nov 2, 2021
Read more comments on GitHub >

github_iconTop Results From Across the Web

ReactNative Metro Bundler not starting automatically
I tried following steps it resolves my issue. Running packager on different port react-native start --port 8084 --reset-cache ...
Read more >
@expo/metro-config | Yarn - Package Manager
A Metro config for running React Native projects with the Metro bundler. Exotic. When enabled, exotic mode adds the following assumptions:.
Read more >
Troubleshooting - React Native
The Metro bundler runs on port 8081. If another process is already using that port, you can either terminate that process, or change...
Read more >
Am I the only one who struggle this much ? : r/reactnative
Finally, have you done a `react-native` init lately? There have been lots of core changes (like the addition of the metro.config.js file) ...
Read more >
Configuring Metro - Meta Open Source
A Metro config can be created in these three ways (ordered by ... When Metro is started via the React Native CLI, some...
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