Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: bundling failed: Error: Unable to resolve module `react-native-vector-icons/Feather`

In React native I'm simply applying a Flatlist from react native library. Succefully installed all libraries

pakage.json

  "dependencies": {
    "feather-icons-react": "^0.3.0",
    "react": "16.6.3",
    "react-native": "0.57.8",
    "react-native-elements": "^1.0.0-beta7",
    "react-native-vector-icons": "^4.2.0"
  },
  "devDependencies": {
    "babel-jest": "23.6.0",
    "jest": "23.6.0",
    "metro-react-native-babel-preset": "0.51.0",
    "react-test-renderer": "16.6.3"
  },
  "jest": {
    "preset": "react-native"
  }
}

App.js

import React, {Component} from 'react';
import Main from './components/MainComponents';

const instructions = Platform.select({
  ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
  android:
    'Double tap R on your keyboard to reload,\n' +
    'Shake or press menu button for dev menu',
});

type Props = {};
export default class App extends Component<Props> {
  render() {
    return (

        <Main />

    );
  }
}

error log

    error: bundling failed: Error: Unable to resolve module `react-native-vector-icons/Feather` from `F:\React Native\FirstProject\node_modules\react-native-elements\src\helpers\getIconType.js`: Module `react-native-vector-icons/Feather` does not exist in the Haste module map

newbie to react native

Help will be highy appreciated

Thankyou

like image 345
Muhammad Ashfaq Avatar asked Dec 21 '18 15:12

Muhammad Ashfaq


People also ask

How do you install react-native vector icons in react-native?

Just follow these steps: Browse to node_modules/react-native-vector-icons and drag the folder Fonts (or just the ones you want) to your project in Xcode. Make sure your app is checked under "Add to targets" and that "Create groups" is checked if you add the whole folder.


1 Answers

To install react-native-vector-icons, you need to install it, then link it. First run:
npm install react-native-vector-icons --save
or if you use yarn
yarn add react-native-vector-icons

Then, you will have to link it like this:
react-native link react-native-vector-icons

like image 80
Vincent D'amour Avatar answered Oct 01 '22 14:10

Vincent D'amour