vbenjs / vite-plugin-svg-icons

Vite Plugin for fast creating SVG sprites.
MIT License
819 stars 111 forks source link

Internal server error: Failed to resolve import "virtual:svg-icons-register" from "src\main.ts" #34

Open wfz8023 opened 2 years ago

wfz8023 commented 2 years ago

有人遇到过这种情况吗,vite-plugin-svg-icons 也装上了, 1639404056(1)希望有知道的大佬能给解惑

jarda-svoboda commented 2 years ago

Having the same issue when trying to integrate with Svelte...

anncwb commented 2 years ago

Can you give me a reproduction? or run the playground https://github.com/vbenjs/vite-plugin-svg-icons/blob/main/packages/playground/basic/vite.config.ts

nternetinspired commented 2 years ago

I ran into this issue yesterday. It occurred after I ran npm audit fix --force because that command reverted this plugin to v.0.1.1 to mitigate an issue with a dependency:


postcss  <8.2.13
Severity: moderate
Regular Expression Denial of Service in postcss - https://github.com/advisories/GHSA-566m-qj78-rww5
fix available via `npm audit fix --force`
Will install vite-plugin-svg-icons@0.1.0, which is a breaking change
node_modules/svg-baker/node_modules/postcss
  svg-baker  >=1.2.5
  Depends on vulnerable versions of postcss
  node_modules/svg-baker
    vite-plugin-svg-icons  >=0.1.1
    Depends on vulnerable versions of svg-baker
    node_modules/vite-plugin-svg-icons
flyeagleyuan commented 2 years ago

有人遇到过这种情况吗,vite-plugin-svg-icons 也装上了, 1639404056(1)希望有知道的大佬能给解惑

i have the same problem. First,it's work,just eslint came error when commit.I add //eslint-disable-line.it's ok.

a847244052 commented 2 years ago

要么是没安装好 要么是vite config没保存,别问我怎么知道【狗头】

ragingDream commented 1 year ago

可能是vite.config.js相关的plugins配置你没写对,别问我怎么知道【笑哭】

victorvaldez5 commented 1 year ago

I ran into this issue and figured out that it was being caused by eslint. adding // eslint-disable-next-line import/no-unresolved before the import solved it for us. We were running on docker compose and we also had to restart the docker container afterwards

morgan2333 commented 1 year ago

反复确认配置没写错后,最终npm run dev重新编译项目后解决了