Blade-icons | Unable to locate a class or view for component

Did you solve this problem?
I had some problems to installing blade-ui-kit/blade-icons package and got the same error.

Fixed by:

  1. Install with composer require blade-ui-kit/blade-icons in sage theme root folder, not bedrock root folder.
  2. Create folder called config in theme root folder
  3. Run wp acorn package:discover or else package config might not be detected/able to publish config-file
  4. Run wp acorn vendor:publish --tag=blade-icons to publish config file to config folder.
  5. In config -file, uncomment everything and let path be resources/svg and create that folder in resources (or change if you want).
  6. In bud.config.mjs add svg to assets array like this .assets(["images","svg"]) (if you chose to create the svg -folder)
  7. Run wp acorn config:clear in theme root folder.
  8. Add your icons/svg -files to resources/svg
  9. Run yarn build and yarn dev
  10. Run wp acorn optimize
  11. Run wp acorn icons:cache
  12. Use <x-icon-name_of_svg_file /> to display the icon.

Don’t know if all this is necessary but it worked for me.
And instead of installing an entire icon library now you can download individual icons from those packages and just put them in your svg-folder and save some loading time. Or if you want a entire package you could still try above steps except with that package. But first remove the blade-ui-kit/blade-icons package as it is already included in the other packages I believe.

6 Likes