oktaysenkan/monicon

Error: You need to add it to the "icons" array in the plugin options and restart the bundler.

Closed this issue · 2 comments

"expo": "^51.0.36",
"react-native-svg": "15.2.0",
"react-native-iconify": "^2.0.3",

<Iconify icon="mdi:heart" size={24} color="#900" />

module.exports = function (api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: [
      // for short paths, must be mirrored with tsconfig
      [
        'module-resolver',
        {
          extensions: ['.ts', '.tsx', '.js', '.jsx', '.ios.js', '.android.js'],
          alias: {
            '@app': './src',
          },
        },
      ],
      [
        'react-native-iconify/babel',
        {
          icons: [
            'mdi:heart',
            'mdi:home',
            'mdi:account',
            'feather:activity',
            // Add more icons here
          ],
        },
      ],
      // fix for web caused by react-native-reanimated
      // https://github.com/software-mansion/react-native-reanimated/issues/1823#issuecomment-1384307084
      '@babel/plugin-proposal-export-namespace-from',
      'react-native-reanimated/plugin',
    ],
  };
};

 ERROR  Error: [React Native Iconify]

Icon "mdi:heart" not found in babel.config.js

You need to add it to the "icons" array in the plugin options and restart the bundler. 

Example:

[
  "react-native-iconify",
  { icons: ["mdi:home"] }
]

This error is located at:
    in P (created by SearchBar)
    in RCTView (created by View)
    in View
    in View (created by SearchBar)
    in RCTView (created by View)
    in View
    in View (created by SearchBar)
    in RCTView (created by View)
    in View
   ...............................................

add mdi:heart to icons array or reset metro bundler

Thanks @oktaysenkan for the quick response, This is not an issue, I tried running 'yarn start --reset-cache' working awesome.
❤️