oktaysenkan / monicon

Universal Icon Library
https://monicon-docs.vercel.app
247 stars 9 forks source link

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

Closed AnilDCoder closed 1 week ago

AnilDCoder commented 1 week ago
"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
   ...............................................
oktaysenkan commented 1 week ago

add mdi:heart to icons array or reset metro bundler

AnilDCoder commented 1 week ago

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