JetBrains / svg-sprite-loader

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

Error: Module build failed (from ./node_modules/svg-sprite-loader/lib/loader.js): InvalidSvg: svg-sprite-loader exception. #329

Open m131-8 opened 5 years ago

m131-8 commented 5 years ago

Error: Module build failed (from ./node_modules/svg-sprite-loader/lib/loader.js): InvalidSvg: svg-sprite-loader exception.

module.exports = webpack_public_path + "static/media/admin.5268f502.svg"; at Object.loader (/Users/xiefeng/gitlab-hz/my/react-antd-admin/node_modules/svg-sprite-loader/lib/loader.js:30:11)

i want to know why?

my webpack.config.js configuration { test: /.svg$/, loader: require.resolve('svg-sprite-loader'), include: [path.resolve(dirname, 'src/icons')], options: { symbolId: 'icon-[name]' } }, { test: [/.bmp$/, /.gif$/, /.jpe?g$/, /.png$/, /.svg$/], loader: require.resolve('url-loader'), exclude: [path.resolve(dirname, 'src/icons')], options: { limit: 10000, name: 'static/media/[name].[hash:8].[ext]', }, },

PanicaCC commented 5 years ago

{ test: /.svg$/, use: [ { loader: 'svg-sprite-loader', options: { extract: false, // this resolve my conflict symbolId: 'icon-[name]', publicPath: '/svg/', spriteFilename: svgPath => sprite${svgPath.substr(-4)} } } ] }

i'm not use url-loader

BoyaZhang commented 5 years ago

has anybody solved this problem? exactly the same one...

AllienWorks commented 4 years ago

See this for answer: https://github.com/kisenka/svg-sprite-loader/issues/149#issuecomment-343839674

jarvanstack commented 1 year ago

same problem