I'm using your loader with vue 2.3.4 and after runing webpack and checking it in the browser it says Invalid Component definition but when i check the .svg it shows for example:
module.exports = {template: '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M6 2l2-2h4l2 2h4v2H2V2h4zM3 6h14l-1 14H4L3 6zm5 2v10h1V8H8zm3 0v10h1V8h-1z"/></svg>'};
I don't know why it isn't working.
@santigarcor Could you attach your svg file?
@visualfanatic
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M3.94 6.5L2.22 3.64l1.42-1.42L6.5 3.94c.52-.3 1.1-.54 1.7-.7L9 0h2l.8 3.24c.6.16 1.18.4 1.7.7l2.86-1.72 1.42 1.42-1.72 2.86c.3.52.54 1.1.7 1.7L20 9v2l-3.24.8c-.16.6-.4 1.18-.7 1.7l1.72 2.86-1.42 1.42-2.86-1.72c-.52.3-1.1.54-1.7.7L11 20H9l-.8-3.24c-.6-.16-1.18-.4-1.7-.7l-2.86 1.72-1.42-1.42 1.72-2.86c-.3-.52-.54-1.1-.7-1.7L0 11V9l3.24-.8c.16-.6.4-1.18.7-1.7zM10 13a3 3 0 1 0 0-6 3 3 0 0 0 0 6z"/></svg>
Weird, could you try updating to v0.2?
same problem here..
https://github.com/visualfanatic/vue-svg-loader/issues/1#issuecomment-268308578 solved it for me.
@santigarcor, @sijakret, @havgry, @sterlini-fueled: do you still have this problem? Let me know, so we can find a solution 馃憤
For me it was definitely just a conflict between file-loader and vue-svg-loader on the matched file types in my webpack configuration (see my reference above). I haven't had any issues since then.
Perhaps it would be a good idea to add a reminder in the readme to check for conflicts with other existing rules.
i think it was the same for me - thanks!
haven't had any issues recently, a mention of potential conflicts with other loaders is for sure not a bad idea!
Most helpful comment
For me it was definitely just a conflict between file-loader and vue-svg-loader on the matched file types in my webpack configuration (see my reference above). I haven't had any issues since then.
Perhaps it would be a good idea to add a reminder in the readme to check for conflicts with other existing rules.