JetBrains / svg-sprite-loader

Webpack loader for creating SVG sprites.
MIT License
2.02k stars 273 forks source link

Module parse failed: unexpected token error #260

Open raj-pel opened 6 years ago

raj-pel commented 6 years ago

I am facing

ERROR in ./client/assets/section3_illustration.svg
Module parse failed: C:\xampp\htdocs\regmern\client\assets\section3_illustration.svg Unexpected token (1:0)
You may need an appropriate loader to handle this file type.
| <?xml version="1.0" encoding="utf-8"?>
| <!-- Generator: Adobe Illustrator 22.0.0, SVG Export Plug-In .

issue in my local dev Could you please tell me how to resolve

}, { test: /\.(svg)$/i, exclude: /node_modules/, include: /client\/assets\//, use: [ { loader: 'svg-sprite-loader', options: { extract: true, spriteFilename: 'icons.svg' } }, { loader: 'svgo-loader' }, ] }, // }, {

kisenka commented 6 years ago

Could you please create repo with minimal setup to demonstrate a problem (package.json, webpack config, SVG image and piece of your code). If you don't want to create a repository - you can create a gist with multiple files.

kisenka commented 6 years ago

@raj-pel ping

joepagan commented 5 years ago

In the past I have had issues where .svg files contain:

<!-- Generator: Adobe Illustrator 22.0.0, SVG Export Plug-In ...

IIRC stripping those lines out of the SVGs has worked in the past so the first line containers <svg ....

Poylar commented 2 years ago

Still facing this issue

Poylar commented 2 years ago

https://github.com/JetBrains/svg-sprite-loader/issues/65#issuecomment-256903682