Open rudolfbyker opened 1 year ago
yeah i counter this error. i end up change manual for vuetify
Is there any solution for this?
Using the following config:
import { aliases, mdi } from 'vuetify/iconsets/mdi-svg';
// defineNuxtConfig - vuetify:
vuetify: {
/* vuetify options */
vuetifyOptions: {
icons: {
defaultSet: 'mdi',
aliases,
sets: {
mdi,
},
},
},
}
}
But still getting the error
Also having the error.
@AchoArnold @rudolfbyker @fikrihanda @Dominic-Marcelino @jvhellemondt As a workaround you can import the icons as follows:
<script lang="ts" setup>
import {mdiGoogle} from '@mdi/js'
</script>
<template>
<v-icon :icon="`svg:${mdiGoogle}`" />
</template>
This does not need any pre-configuration settings
Now the real issue comes when implementing custom icons and hopefully this gets supported soon.
In nuxt.config.ts
file, this is the config:
vuetifyOptions: {
icons: {
sets: {
custom: {
EIconGoogle: {
component: () => import('@/components/icons/EIconGoogle/Index.vue'),
props: {
name: 'EIconGoogle'
}
}
}
}
},
},
in the template of any component:
<v-icon icon="custom:EIconGoogle" />
Here is the Error generating when using SSR:
500
src.replace is not a function
at renderVNode (C:\Users\Nasr\Desktop\egab-nuxt3\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:720:34)
at renderComponentSubTree (C:\Users\Nasr\Desktop\egab-nuxt3\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:698:7)
at renderComponentVNode (C:\Users\Nasr\Desktop\egab-nuxt3\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:631:12)
at renderVNode (C:\Users\Nasr\Desktop\egab-nuxt3\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:743:14)
at renderVNodeChildren (C:\Users\Nasr\Desktop\egab-nuxt3\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:759:5)
at renderElementVNode (C:\Users\Nasr\Desktop\egab-nuxt3\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:806:9)
at renderVNode (C:\Users\Nasr\Desktop\egab-nuxt3\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:741:9)
at renderComponentSubTree (C:\Users\Nasr\Desktop\egab-nuxt3\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:698:7)
at renderComponentVNode (C:\Users\Nasr\Desktop\egab-nuxt3\node_modules\@vue\server-renderer\dist\server-renderer.cjs.js:631:12)
I'm also having this error, but i can confirm, that this workaround works for now
<script lang="ts" setup>
import {mdiGoogle} from '@mdi/js'
</script>
<template>
<v-icon :icon="`svg:${mdiGoogle}`" />
</template>
I believe this is an issue related to Vuetify, I'm having the same problem using vuetify-nuxt-module. On browser inspect, the SVG path gets added to the element's class attribute.
Contact Details
rudolfbyker@gmail.com
What happened?
When trying to use VIcon with SVG paths, I get an error.
Reproduction: https://codesandbox.io/p/sandbox/zen-wood-npt83m (Check the
yarn dev
setup task in the terminal)Version
1.0.2 (Default)
What browsers are you seeing the problem on?
No response
Relevant log output
Additional context
No response