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.

Use metro-bundler from master

See original GitHub issue

At Facebook we use both react-native and metro-bundler from master. The open source version of react-native depends on a concrete version of metro from npm. We often break react-native when we change the module boundaries in a single diff for both repos internally at Facebook, and this is not ideal as it breaks the react-native repo and requires us to bump a Metro version.

Instead, I propose to:

  • Change react-native to depend on github’s version of Metro from master
  • Compile Metro using babel-register and link it into node_modules/metro-bundler
  • When making an RN release, publish a new version of Metro and lock that version into package.json

It’s possible that we still break react-native master if the two repos diverge or the sync script for metro-bundler is delayed, but that shouldn’t happen often and is the cause of another issue that can be fixed (or will fix itself with time). I think this will lead to fewer breakages from us and allow everyone to move faster 😃

@brentvatne @grabbou know anyone who could work on this?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:27 (25 by maintainers)

github_iconTop GitHub Comments

4reactions
cpojercommented, Sep 15, 2017

@nihgwu this is not the right issue to discuss that. In the future there may be a way for you to pick any version of Metro together with React Native. In the meantime, you can use the selective versions resolution feature we built into Yarn and outlined in the 1.0 blogpost: https://code.facebook.com/posts/274518539716230/announcing-yarn-1-0/

3reactions
nihgwucommented, Sep 15, 2017

sorry to break the topic, I’m using RN0.49RC with metro-bundler@^0.13.0, and I can’t start my app because I’m using moment, and it always breaks here, but I don’t get that error with previous RN versions, so I believe that’s a issue from metro-bundler, but as RN has a lock version of it, unless we cherry-pick the right version with the patch, it will always break, I have to comment out that line every time I run yarn add

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using metro-bundler on a web application - Medium
We all know metro as the react-native bundler, as the project that was only created to work with react-native, to generate code that...
Read more >
How to run Metro Bundler in VS Code integrated terminal ...
First close all the Metro server, and then Open a new terminal in VS code and then run the command. npx react-native start....
Read more >
Metro bundler - Expo Documentation
Expo CLI uses Metro during npx expo start and npx expo export to bundle your JavaScript code and assets. Metro is built and...
Read more >
Evan Bacon on Twitter: "esbuild is a bundler written with ...
No reason React Native devs shouldn't be able to use the latest and greatest of web tooling. ... Or is it a bundler...
Read more >
react-native-meet-up - npm
Start using react-native-meet-up in your project by running `npm i ... between react-native-meet-up and react-native in metro bundler.
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