1

I've got a simple Nuxt project that I'm working on, I installed Vue Icons and tried to add a search icon to my component, but when compiling I get the following error:

This dependency was not found:                                                                                                                                                 
                                                                                                                                                                               
* @vue-icons/feather in ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./components/SiteHeader.vue?vue&type=script&lang=js&       
                                                                                                                                                                              
To install it, you can run: npm install --save @vue-icons/feather   

But I already have it installed, both on my src, and functions folders (I'm hosting on firebase)

"dependencies": {
  "@nuxtjs/firebase": "^7.6.1",
  "@vue-icons/feather": "^1.0.19",
  "firebase": "^8.9.1",
  "isomorphic-fetch": "^3.0.0",
  "nuxt": "^2.0.0"
}

The import statement I'm using is the one directly copied from the website

import { SearchIcon } from "@vue-icons/feather";

I some similar questions I read talked about transpiling the library, but that did not seem to work, do I need to add 3rd party libraries to some other part of the nuxt.config file?

kissu
  • 40,416
  • 14
  • 65
  • 133
Danyx
  • 574
  • 7
  • 34

1 Answers1

0

I'll quote what is written in the documentation

This project aims to regroup [...] common icons pack for Vue 3.

Nuxt2 is not compatible with Vue3.

If you want to use the exact same vue-feather-icons library, please use this package for that purpose.

It should work as easily as

<template>
  <div>
    <ActivityIcon />
  </div>
</template>

<script>
import { ActivityIcon } from 'vue-feather-icons'

export default {
  components: {
    ActivityIcon
  }
}
</script>

Otherwise, I can also recommend unplugin-icons which will provide a LOT more and will be really flexible. And which also totally contains the icons you're looking for.

Awesome package, to not have to deal with all the annoying parts of looking up for a working packages on top of the other features.

kissu
  • 40,416
  • 14
  • 65
  • 133