Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Vue warn]: Invalid Component definition #83

Closed
pepelxD opened this issue May 23, 2019 · 6 comments
Closed

[Vue warn]: Invalid Component definition #83

pepelxD opened this issue May 23, 2019 · 6 comments

Comments

@pepelxD
Copy link

pepelxD commented May 23, 2019

Good afternoon, I try to use the plugin, but I get an error Invalid Component definition. What could be the problem?
I do everything as described. I use vue cli 3. I changed the loader for svg in the file vue.config.js but this does not help ...
This is what the vue inspect command gives me https://yadi.sk/d/-frdPIPX5dSamA I don’t see there anything else that can interfere with the processing

@Shuunen
Copy link

Shuunen commented Jan 6, 2020

Same here 😢

@WofWca
Copy link

WofWca commented Feb 4, 2020

What's the line where the error occurs and what gets imported?

@markhuot
Copy link

The problem for me was my webpack loader configuration. I'm using Storybook and the default webpack config includes an image loader that was catching my .svg files. The fix was to remove svg from the default image loader as described here: storybookjs/storybook#6758 (comment).

@antoniandre
Copy link

It did not work for me after copying exactly the Vue Cli code from https://vue-svg-loader.js.org/faq.html#how-to-use-both-inline-and-external-svgs,

As I have both inline svg and external.

I was actually placing the inline keyword at the wrong place, it has to be that and not the opposite:

js

import Wave from '@/assets/file.svg?inline'

css

background: url('~@/assets/another-file.svg') bottom;

@bbugh
Copy link

bbugh commented Sep 3, 2020

If anyone ends up here trying to use this with Rails webpacker, you have to modify the webpacker-provided file loader to remove .svg.

// environment.js
const fileLoader = environment.loaders.get('file')
fileLoader.test = new RegExp(fileLoader.test.source.replace(/\|?\.svg/, ''), 'i')

@sebbean
Copy link

sebbean commented Oct 14, 2021

@bbugh you beautiful beautiful boy you just saved me an afternoon

@rafaelmonroy thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants