damianstasik / vue-svg-loader

🔨 webpack loader that lets you use SVG files as Vue components
https://vue-svg-loader.js.org
MIT License
644 stars 86 forks source link

Syntax Error: NonErrorEmittedError: (Emitted value instead of an instance of Error) Error in parsing SVG: Non-whitespace before first tag. #177

Open dengxp opened 2 years ago

dengxp commented 2 years ago

error in ./src/assets/logo.svg?inline

Syntax Error: NonErrorEmittedError: (Emitted value instead of an instance of Error) Error in parsing SVG: Non-whitespace before first tag. Line: 0 Column: 1 Char: m

@ ./node_modules/cache-loader/dist/cjs.js??ref--13-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader-v16/dist??ref--1-1!./src/layouts/BasicLayout.vue?vue &type=script&lang=js 12:0-48 19:13-20 @ ./src/layouts/BasicLayout.vue?vue&type=script&lang=js @ ./src/layouts/BasicLayout.vue @ ./src/layouts/index.js @ ./src/config/router.config.js @ ./src/router/index.js @ ./src/globalApp.js @ ./src/main.js @ multi (webpack)-dev-server/client?http://192.168.2.82:8001&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

vue.config.js config: const svgRule = config.module.rule('svg') svgRule.uses.clear() svgRule .oneOf('inline') .resourceQuery(/inline/) .use('vue-loader') .loader('vue-loader') .end() .use('vue-svg-loader') .loader('vue-svg-loader') .end()

module version: "vue": "^3.2.26", "vue-svg-loader": "0.17.0-beta.2"

Aryan3212 commented 1 year ago

It would help if you shared the contents of the svg.