error: bundling failed: Error: While resolving module react-native-vector-icons
/Ionicons, the Haste package react-native-vector-icons was found. However the
module Ionicons could not be found within the package.
I'm seeing this too as of today. It appears to be a new issue.
error: bundling failed: Error: While resolving modulereact-native-vector-icons/FontAwesome, the Haste packagereact-native-vector-iconswas found. However the moduleFontAwesomecould not be found within the package. Indeed, none of these files exist:
I found the solution.Delete this file.
rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json
Delete file package.json
I am see this too.
@junge68 - what would you need to clean/reset/etc to try your suggestion? I renamed the file and did a yarn cache clean, but this didn't help...
Loading dependency graph, done.
error: bundling failed: Error: While resolving module `react-native-vector-icons/MaterialIcons`, the Haste package `react-native-vector-icons` was found. However the module `MaterialIcons` could not be found within the package. Indeed, none of these files exist:
* `/Users/Greg/Dropbox/source_reactnative/gctodo_v2/node_modules/react-native/local-cli/core/__fixtures__/files/MaterialIcons(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
* `/Users/Greg/Dropbox/source_reactnative/gctodo_v2/node_modules/react-native/local-cli/core/__fixtures__/files/MaterialIcons/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
at resolveHasteName (/Users/Greg/Dropbox/source_reactnative/gctodo_v2/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:387:9)
at ModuleResolver._resolveDependency (/Users/Greg/Dropbox/source_reactnative/gctodo_v2/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:317:37)
at ModuleResolver.resolveDependency (/Users/Greg/Dropbox/source_reactnative/gctodo_v2/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:313:877)
at ResolutionRequest.resolveDependency (/Users/Greg/Dropbox/source_reactnative/gctodo_v2/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:97:16)
at DependencyGraph.resolveDependency (/Users/Greg/Dropbox/source_reactnative/gctodo_v2/node_modules/metro/src/node-haste/DependencyGraph.js:269:4352)
at /Users/Greg/Dropbox/source_reactnative/gctodo_v2/node_modules/metro/src/DeltaBundler/traverseDependencies.js:201:36
at Generator.next (<anonymous>)
at step (/Users/Greg/Dropbox/source_reactnative/gctodo_v2/node_modules/metro/src/DeltaBundler/traverseDependencies.js:256:306)
at /Users/Greg/Dropbox/source_reactnative/gctodo_v2/node_modules/metro/src/DeltaBundler/traverseDependencies.js:256:536
at Promise (<anonymous>)
BUNDLE [ios, dev] ./index.js 鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枔鈻撯枒鈻戔枒鈻戔枒 73.0% (493/577), failed.
update: tried again and worked (I think doing the cache cleans etc may have put the file back perhaps?)
Also ran into this problem today. Same exact error.
Update: I deleted the JSON file at node_modules/react-native/local-cli/core/__fixtures__/files/package.json and restarted my project server. Works fine now.
However, I think the core issue is in the core code. Apparently this may be a bigger issue.
Facing same issue deleting node_modules/react-native/local-cli/core/fixtures/files/package.json doesnt help.any other solution?
With the latest RN version 0.52.1 the file to remove is located here:
rm node_modules/react-native/local-cli/core/__fixtures__/files/package.json
Lets get this change merged!!!
rm node_modules/react-native/local-cli/core/__fixtures__/files/package.json worked for me.
@ccjeaty is it good practice or permanent solution to this issue? Will be there be any further conflicts if proceed to do so?
it's a bad practice, it's only a temporal solution...
@jdnichollsc Thank you. Could you suggest any solution for this?
Deleting that package.json did fix my issue but I didnt like this solution since I will have to delete it everytime I face such issue.. But anyhow thanks guys, it took me 4 hours to find this solution :P ..
@Yandamuri sorry, I'm learning React Native, I don't know for the moment
This needs to be fixed properly, this is a critical issue +1.
I'm seeing this from metro-bundler:
bundling failed: Error: While resolving module
react-native-vector-icons/FontAwesome, the Haste packagereact-native-vector-iconswas found. However the moduleFontAwesomecould not be found within the package. Indeed, none of these files exist
Similar to what others are seeing. I haven't touched or upgraded anything in react-native-vector-icons. What I changed on native side that could have triggered this is upgrading react-native-firebase, followed by a pod update.
https://github.com/oblador/react-native-vector-icons/issues/630#issuecomment-358196396 's solution works but obviously addressing the symptom, not the cause. This should be filed upstream to react-native? I'm not even sure how to file when it's not consistently reproducible, other than my last comment?
Dup of #626
it's an RN issue https://github.com/facebook/react-native/issues/17610
Will be fixed by https://github.com/facebook/react-native/pull/17672
Workaround https://github.com/oblador/react-native-vector-icons/issues/626#issuecomment-362386341
Thanks @MoOx for the helpful summary. :)
@MoOx
Will be fixed by facebook/react-native#17672
is it permanent fix?
@mtt87 Thanks it worked for me.
@Yandamuri yes it will. Nothing is wrong in this package. It's RN repo that contains the name of this package (and it should not).
thanks @mtt87 .It works like a charm
馃挴
Correction: This is fixed in Version 0.54.4 of React Native
4 months later and this still isn't fixed in React Native 0.53.3.
Quick fix as others point out is to run rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json but you'll need to do this after every fresh npm install.
So, to run this automatically, you can add it to your package.json as a postinstall script:
package.json
"scripts": {
"postinstall": "rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json"
}
Yup, fine with me on RN 0.54.4
I found the solution.Delete this file.
rm ./node_modules/react-native/local-cli/core/fixtures/files/package.json
Delete file package.json
I delete this file but error continued. :c
@13ArturBruno if on RN0.52+ you need `rm node_modules/react-native/local-cli/core/__fixtures__/files/package.json
Most helpful comment
With the latest RN version
0.52.1the file to remove is located here:rm node_modules/react-native/local-cli/core/__fixtures__/files/package.json