Closed jojowwbb closed 1 year ago
Hi, does it work when omitting the ?component
param?
Hi, does it work when omitting the
?component
param?
no!
Could you share a Code Sandbox to reproduce the problem?
Closed after 60 days of inactivity
did this error get sorted? I got the same for importing from assets folder & i'm completely new at this,Plz help
"vite": "^2.9.2", "vite-svg-loader": "^3.2.0",
tsconfig.json
{ "compilerOptions": { "target": "esnext", "useDefineForClassFields": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "strict": true, "jsx": "preserve", "sourceMap": true, "isolatedModules": false, "esModuleInterop": true, "allowSyntheticDefaultImports": true, "typeRoots": [ "./@types" ], "lib": [ "esnext", "dom" ] }, "include": [ "@types/*.d.ts", "src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue" ], "references": [ { "path": "./tsconfig.node.json" } ] }
then,show the error:
下午11:07:21 [vite] Internal server error: Failed to resolve import "./banner.svg?component" from "src/pages/test/index.vue". Does the file exist? Plugin: vite:import-analysis File: /Users/glodon/workspace/glodon/mls-web/src/pages/test/index.vue 4 | import { ref } from "vue"; 5 | import { UploadFilled } from "@element-plus/icons-vue"; 6 | import IconComponent from "./banner.svg?component"; | ^ 7 | const _sfc_main = / @PURE / _defineComponent({ 8 | emits: ["onChange"],
the file 'banner.svg' had exists!