Error: While resolving module `react-native-vector-icons/MaterialIcons`, the Haste package `react-native-vector-icons` was found.
See original GitHub issueAfter upgrading my react native project and also my react-native-vector-icons I started receiving this error.
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/user/my-app/node_modules/react-native/local-cli/core/__fixtures__/files/MaterialIcons(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
* `/Users/user/my-app/node_modules/react-native/local-cli/core/__fixtures__/files/MaterialIcons/index(.native||.ios.js|.native.js|.js|.ios.json|.native.json|.json)`
The same issue happens with Font Awesome
Module | Version |
---|---|
React-Native | 0.52.0 |
React | 16.2.0 |
React-native-vector-icons | 4.5.0 |
Issue Analytics
- State:
- Created 6 years ago
- Reactions:198
- Comments:71 (3 by maintainers)
Top Results From Across the Web
Error: While resolving module `react-native-vector-icons ...
Ever had this error? "error: bundling failed: Error: While resolving module `react-native-vector-icons/FontAwesome`, the Haste package ...
Read more >The Haste package 'react-native-vector-icons' error in react ...
While resolving module react-native-vector-icons /FontAwesome , the Haste package react-native-vector-icons was found. However the module ...
Read more >the haste package was found, react-native-vector-icons npm ...
Error : While resolving module App/Config, the Haste package App was found. However the module Config could not be found within the package....
Read more >Example to Use React Native Vector Icons
Lastly, Import icon component in your project and start using it. How to use Icon Component? For the Vector Icons, we have to...
Read more >unable to resolve "react-native-elements" - You.com
Cannot find module 'react-native-elements'. Asked Jun 4, 2020 · 1 ; error: bundling failed: Error: Unable to resolve module `react-native-vector-icons/Feather`.
Read more >
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The file it is trying to find does in fact declare that module.
This is why it breaks now: https://github.com/facebook/metro/issues/139#issuecomment-366213751
Related issue: https://github.com/oblador/react-native-vector-icons/issues/379
The broken file: https://github.com/facebook/react-native/blob/master/local-cli/core/__fixtures__/files/package.json
Workaround
rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json
restart packagerI added this to
package.json
using RN v0.52