Closed ynechaev closed 10 months ago
I checked my older Nuxt 3 project and version "@heroicons/vue": "v1"
seems to be working (although still producing hydration warnings and import is slightly different with no size part in the path).
Hey! Do you mind sharing a minimal reproduction of this issue as a Git repo so that we can easily reproduce the problem on our end? Thanks!
Also, just a follow up on this, generally this warning means that the component has not been imported properly (or alternatively, globally registered). Here's an example from the readme:
<template>
<div>
<BeakerIcon class="h-6 w-6 text-blue-500" />
<p>...</p>
</div>
</template>
<script setup>
import { BeakerIcon } from '@heroicons/vue/24/solid'
</script>
Also, just in case, if you're not using <script setup>
, you'll need to also register this component:
<template>
<div>
<BeakerIcon class="h-6 w-6 text-blue-500" />
<p>...</p>
</div>
</template>
<script>
import { BeakerIcon } from '@heroicons/vue/24/solid'
export default {
components: { BeakerIcon },
}
</script>
Let me know if that helps 👍
Adding components export solved the issue, thanks!
Great, glad you got it figured out 🤙
After following the docs and installing
"@heroicons/vue": "^2.0.18"
in my Nuxt 3 project, I get the following error:Icon is not rendered and logs contain the following error in addition to the above:
I tried adding heroicons into transpiler build options, but it didn't help to resolve this issue:
Here is my package.json contents: