Hi there. I'm trying to get svg-to-vue-component up and running and I've hit a road block. I installed the npm module, and copy/pasted the Vue CLI config into vue.config.js. When I try to run vue-cli-service serve, I get the following error:
Syntax Error: TypeError: Cannot read property 'parseComponent' of undefined
module.exports = {
chainWebpack(config) {
// only convert .svg files that are imported by these files as vue component
const fileRegex = /\.(vue|js|ts|svg)$/
// use vue-cli's default rule for svg in non .vue .js .ts files
config.module.rule('svg').issuer((file) => { return !fileRegex.test(file) })
// use our loader to handle svg imported by other files
config.module
.rule('svg-component')
.test(/\.svg$/)
.issuer((file) => { return fileRegex.test(file) })
.use('vue')
.loader('vue-loader')
.end()
.use('svg-to-vue-component')
.loader('svg-to-vue-component/loader')
},
}
I'm not sure what I'm doing wrong. I'm using Vue 3, so maybe that's the issue? Any help would be appreciated!
Hi there. I'm trying to get svg-to-vue-component up and running and I've hit a road block. I installed the npm module, and copy/pasted the Vue CLI config into
vue.config.js
. When I try to runvue-cli-service serve
, I get the following error:Vue Component
SVG
vue.config.js
I'm not sure what I'm doing wrong. I'm using Vue 3, so maybe that's the issue? Any help would be appreciated!