antonreshetov / vue-unicons

1000+ Pixel-perfect svg icons for your next project as Vue components
https://antonreshetov.github.io/vue-unicons/
MIT License
998 stars 55 forks source link

Build error with vite: "openBlock' is not exported" #49

Closed sheoak closed 3 years ago

sheoak commented 3 years ago

When building vue 3 app with vite, I get the following error with vue-unicons:

openBlock' is not exported by node_modules/vue-unicons/node_modules/vue/dist/vue.runtime.esm.js, imported by node_modules/vue-unicons/dist/vue-unicons.es.js

node_modules/vue-unicons/dist/vue-unicons.es.js:1:7

antonreshetov commented 3 years ago

@sheoak use resolve: { dedupe: ['vue'] } in vite.config.js or install vue-unicons@next which solved the problem, vue has been moved to peerDependencies.

sheoak commented 3 years ago

Thanks for the quick reply @antonreshetov ! It seems I can't install the next branch:

npm install --save vue-unicons@next
Could not resolve dependency:
peer vue@"^2.5.22" from vue-unicons@3.2.2-alpha.1
antonreshetov commented 3 years ago

It's not a package issue. Try to remove node_modules and install again or use yarn. Or just use resolve: { dedupe: ['vue'] }

sheoak commented 3 years ago

Yarn works but gives a warning: vue-unicons@3.2.2-alpha.1" has incorrect peer dependency "vue@^2.5.22".

the-prime-thanatos commented 2 years ago

@antonreshetov The same problem in nuxt3:

import {defineNuxtPlugin} from '#app'
import Unicon from 'vue-unicons'
import { uniEye, uniEyeSlash, uniMultiply, uniTimes, uniMultiplyMonochrome, uniMultiplySolid } from 'vue-unicons/dist/icons'

export default defineNuxtPlugin((nuxtApp) => {
    Unicon.add([uniEye, uniEyeSlash, uniMultiply, uniTimes, uniMultiplyMonochrome, uniMultiplySolid]);
    nuxtApp.vueApp.use(Unicon);
})

"vue-unicons": "^3.2.2-alpha.1" "nuxt3": "latest",

mohammedmoutawakkil commented 2 years ago

any solutions ?? i have the same problem