react-native: bundling failed: Error: Unable to resolve module /../react-transform-hmr/lib/index.js
- Review the documentation: https://facebook.github.io/react-native
- Search for existing issues: https://github.com/facebook/react-native/issues
- Use the latest React Native release: https://github.com/facebook/react-native/releases
Environment
React Native Environment Info: System: OS: macOS 10.14 CPU: x64 Intel® Core™ i5-7360U CPU @ 2.30GHz Memory: 97.71 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 10.11.0 - /usr/local/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 IDEs: Android Studio: 3.1 AI-173.4907809 Xcode: /undefined - /usr/bin/xcodebuild npmPackages: react: 16.5.0 => 16.5.0 react-native: 0.57.2 => 0.57.2 npmGlobalPackages: create-react-native-app: 2.0.2 react-native-cli: 2.0.1
Description
BUNDLE [android, dev] …/…/index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1)::ffff:127.0.0.1 - - [06/Oct/2018:10:44:21 +0000] “GET /index.delta?platform=android&dev=true&minify=false HTTP/1.1” 500 - “-” “okhttp/3.10.0”
error: bundling failed: Error: Unable to resolve module ./../react-transform-hmr/lib/index.js
from /Users/andrariztyan/MyProject/mobile/myapp/App.js
: The module ./../react-transform-hmr/lib/index.js
could not be found from /Users/andrariztyan/MyProject/mobile/myapp/App.js
. Indeed, none of these files exist:
/Users/andrariztyan/MyProject/mobile/react-transform-hmr/lib/index.js(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
/Users/andrariztyan/MyProject/mobile/react-transform-hmr/lib/index.js/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)
at ModuleResolver.resolveDependency (/Users/andrariztyan/MyProject/mobile/myapp/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:209:697) at ResolutionRequest.resolveDependency (/Users/andrariztyan/MyProject/mobile/myapp/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:83:16) at DependencyGraph.resolveDependency (/Users/andrariztyan/MyProject/mobile/myapp/node_modules/metro/src/node-haste/DependencyGraph.js:222:485) at Object.resolve (/Users/andrariztyan/MyProject/mobile/myapp/node_modules/metro/src/lib/transformHelpers.js:149:25) at dependencies.map.result (/Users/andrariztyan/MyProject/mobile/myapp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:316:29) at Array.map (<anonymous>) at resolveDependencies (/Users/andrariztyan/MyProject/mobile/myapp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:312:16) at /Users/andrariztyan/MyProject/mobile/myapp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:169:33 at Generator.next (<anonymous>) at step (/Users/andrariztyan/MyProject/mobile/myapp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:271:307) BUNDLE [android, dev] …/…/index.js ░░░░░░░░░░░░░░░░ 0.0% (0/1), failed.
Reproducible Demo
Let us know how to reproduce the issue. Include a code sample, share a project, or share an app that reproduces the issue using https://snack.expo.io/. Please follow the guidelines for providing a MCVE: https://stackoverflow.com/help/mcve
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 11
- Comments: 32
Thanks @Girish2015 for that. I did
react-native start --reset-cache
as proposed, and then in another terminal window I didreact-native run-ios
and Problem Solved.@anasred . react-native start --reset-cache . woked ~
wow!,thank you guys,it worked now!
@anasred thanks!!! ✅
react-native start --reset-cache works
for me!!! ✅Thanks @anasred react-native start --reset-cache works for me.
no one solution above doesn’t work for me. Only one is - run bundler by command
react-native start
and then hit cmd+R in simulatorUPDATE: THANKS, it worked now. using react-native start and another tab terminal react-native run-android
thanks @anasred It worked for me
Gowtham close all the terminals then run that command again.
New projects will be reported /…/react-transform-hmr/lib/index.js not found. 0.57.2 i’m use react-native-cli