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.

[still broken] error: bundling failed: Error: Unable to resolve module `./../react-transform-hmr/lib/index.js

See original GitHub issue

Environment

  React Native Environment Info:
    System:
      OS: macOS 10.14
      CPU: x64 Intel(R) Core(TM) i7-6660U CPU @ 2.40GHz
      Memory: 319.66 MB / 16.00 GB
      Shell: 3.2.57 - /bin/bash
    Binaries:
      Node: 10.11.0 - /usr/local/Cellar/node/10.11.0/bin/node
      Yarn: 1.10.1 - /usr/local/bin/yarn
      npm: 6.4.1 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
    IDEs:
      Xcode: 10.0/10A255 - /usr/bin/xcodebuild
    npmPackages:
      react: 16.5.0 => 16.5.0 
      react-native: 0.57.2 => 0.57.2 

Description

This is a duplicate of https://github.com/facebook/react-native/issues/21490 – but that ticket is resolved, so I cannot comment there.

Mitigation steps remain the same. It appears that a version lock (perhaps the cyclic dependency between metro and metro-config — I couldn’t track it down) prevents yarn from resolving 0.48.0 of metro.

Reproducible Demo

brew install nvm
brew install yarn --without-node
nvm install v10.11.0
nvm use v10.11.0
npx react-native-cli init myapp

Expected

Yarn installs metro 0.48.0

Actual

Yarn installs:

├─ metro-babel-register@0.47.1
├─ metro-babel7-plugin-react-transform@0.47.1
├─ metro-config@0.47.1
├─ metro-memory-fs@0.47.1
├─ metro-minify-uglify@0.47.1
├─ metro-react-native-babel-preset@0.47.1
├─ metro-source-map@0.47.1
├─ metro@0.47.1

In addition, manually installing metro 0.48.0 in the project doesn’t appear to help because yarn will resolve both dependencies.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:5

github_iconTop GitHub Comments

1reaction
kara-rylicommented, Oct 11, 2018

Thanks for the tip, @jjenzz! I actually needed:

  "resolutions": {
    "metro": "^0.48.1",
    "metro-babel-register": "^0.48.1",
    "metro-core": "^0.48.1",
    "metro-memory-fs": "^0.48.1"
  },

To ensure all of the metro-related things were at the same version and unduplicated.

0reactions
kelsetcommented, Oct 12, 2018

Duplicate of #21490

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ask Question - Stack Overflow
Loading dependency graph, done. error: bundling failed: Error: Unable to resolve module ./../../react-transform-hmr/lib/index.js.
Read more >
Evaluating 'expo.default.fileSystem' error - Expo SDK - Forums
im trying to run my app. but i keep getting this error. can anyone help me solve this problem.
Read more >
unable to resolve "firebase" from "app.js" - You.com
error : bundling failed: Error: Unable to resolve module @react-native-firebase/app from /Users/primetimetran/Desktop/rnTodoList/App.js : Module .
Read more >
ESM Modules Broken - Error resolving module specifier “luxon”.
I am using node v17.4.0 and trying to make a very simple web app. This is the tree structure and I have installed...
Read more >
Error: Unable to resolve module `util` – Split Help Center
Running bundle using React Native and Javascript SDK causes an error. Bundling failed: Error: Unable to resolve module `util`.
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