vbenjs / vite-plugin-svg-icons

Vite Plugin for fast creating SVG sprites.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't build in a Nuxt 3 project

nkCreation opened this issue · comments

Hello!
Thank you for your amazing work. The plugin works perfectly in development but during build I have the following error:

ERROR  Error loading virtual:svg-icons-register: plugin load hook should return a string, a { code, map } object, or nothing/null

I use a Nuxt 3 project with Vite and load the plugin in a plugins/svg-icons.js (because I can't edit the main.ts file) with:

import "virtual:svg-icons-register";

export default defineNuxtPlugin(nuxtApp => {
  // Nothing to do here for the moment...
})

Do you have any ideas?
Thank you!

same issue

Hi @Bisheng940924. I've just updated to the Nuxt 3.0.0-rc.3 and it fix the problem.
See nuxt/nuxt#13921