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.

Error: While resolving module `react-native-vector-icons/MaterialIcons`, the Haste package `react-native-vector-icons` was found.

See original GitHub issue

After 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:closed
  • Created 6 years ago
  • Reactions:198
  • Comments:71 (3 by maintainers)

github_iconTop GitHub Comments

1426reactions
chrismcleodcommented, Feb 20, 2018

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 packager

182reactions
gastonmorixecommented, Jan 16, 2018

I added this to package.json using RN v0.52

"scripts": {
    "postinstall": "rm ./node_modules/react-native/local-cli/core/__fixtures__/files/package.json”
}
Read more comments on GitHub >

github_iconTop 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 >

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