0
votes

I am facing following issue when import this:

import Icon from 'react-native-vector-icons/AntDesign';

Error:

error: bundling failed: Error: Unable to resolve module react-native-vector-icons/AntDesign from /Desktop/development/cbcvp-rn/cbcvp/node_modules/react-native-elements/src/helpers/getIconType.js: Module react-native-vector-icons/AntDesign does not exist in the Haste module map

This might be related to https://github.com/facebook/react-native/issues/4968 To resolve try the following: 1. Clear watchman watches: watchman watch-del-all. 2. Delete the node_modules folder: rm -rf node_modules && npm install. 3. Reset Metro Bundler cache: rm -rf /tmp/metro-bundler-cache-* or npm start -- --reset-cache. 4. Remove haste cache: rm -rf /tmp/haste-map-react-native-packager-*. at ModuleResolver.resolveDependency (/Users/amit/Desktop/development/cbcvp-rn/cbcvp/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:161:1460) at ResolutionRequest.resolveDependency (/Users/amit/Desktop/development/cbcvp-rn/cbcvp/node_modules/metro/src/node-haste/DependencyGraph/ResolutionRequest.js:91:16) at DependencyGraph.resolveDependency (/Users/amit/Desktop/development/cbcvp-rn/cbcvp/node_modules/metro/src/node-haste/DependencyGraph.js:272:4579) at dependencies.map.relativePath (/Users/amit/Desktop/development/cbcvp-rn/cbcvp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:376:19) at Array.map () at resolveDependencies (/Users/amit/Desktop/development/cbcvp-rn/cbcvp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:374:16) at /Users/amit/Desktop/development/cbcvp-rn/cbcvp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:212:33 at Generator.next () at step (/Users/amit/Desktop/development/cbcvp-rn/cbcvp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:297:313) at /Users/amit/Desktop/development/cbcvp-rn/cbcvp/node_modules/metro/src/DeltaBundler/traverseDependencies.js:297:473 BUNDLE [ios, dev] ./index.js ▓▓▓▓▓▓░░░░░░░░░░ 38.0% (719/1166), failed.

how to fix this error anyone help me...

Thanks

4
did the issue fixed? I am getting same issueArvind Kumar

4 Answers

1
votes

Run the below commands

npm i react-native-vector-icons
npx react-native link react-native-vector-icons

Hope it helps.

0
votes

Link your library if not linked by using react-native-link. Also try clearing cache and restarting your Metro Bundler. This sometimes occurs after installing any library. Please let me know if it works. Thanks

-1
votes

yarn add react-native-vector-icons
react-native link react-native-vector-icons
hope work for you

-1
votes

react-native link

npm i react-native-vector-icons
npx react-native link react-native-vector-icons

while linking; error No package found. Are you sure this is a React Native project?

error EPERM: operation not permitted, scandir 'E://android/app/build/intermediates/signing_config/debug/out/signing-config.json'. Run CLI with --verbose flag for more details.

I was having this problem for many hours but I figured it out late. It was a stupid mistake at my end. The solution is to run cmd as admin

npx react-native link react-native-vector-icons

and success Assets have been successfully linked to your project