svg-sprite-loader icon indicating copy to clipboard operation
svg-sprite-loader copied to clipboard

Module parse failed: unexpected token error

Open raj-pel opened this issue 7 years ago • 5 comments

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' }, ] }, // }, {

raj-pel avatar Mar 23 '18 09:03 raj-pel

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 avatar Mar 23 '18 11:03 kisenka

@raj-pel ping

kisenka avatar May 01 '18 11:05 kisenka

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 ....

joepagan avatar Jan 10 '19 15:01 joepagan

Still facing this issue

Poylar avatar Aug 06 '22 08:08 Poylar

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

Poylar avatar Aug 06 '22 08:08 Poylar