mrsum / webpack-svgstore-plugin

Simple svg-sprite creating with webpack
https://www.npmjs.com/package/webpack-svgstore-plugin
200 stars 90 forks source link

Silently Fails With Webpack 2 #115

Closed BrysonR closed 7 years ago

BrysonR commented 8 years ago

I know this is jumping the gun since Webpack 2 isn't stable yet, BUT given people are going to be upgrading, or testing upgrading, in the near future, it might be useful to inform devs that their spritesheets have not been created, rather than just failing in the background with no indication.

mrsum commented 8 years ago

Hi! Let's wait for first stable release.

drosen0 commented 8 years ago

Note that right now, webpack's version is specified as

'dist-tags': { latest: '2.1.0-beta.25', beta: '2.1.0-beta.24' },

which means that webpack 2 beta is currently the default install of webpack.

EDIT: Apparently that was a mistake because they've reverted it. It's again safe to wait. The version is now specified as

'dist-tags': { latest: '1.13.2', beta: '2.1.0-beta.25' },
nadavsinai commented 8 years ago

Hi works for me -;) but notice that it gives a warning on the console :

webpack: Using compiler.parser is deprecated.
Use compiler.plugin("compilation", function(compilation, data) {
  data.normalModuleFactory.plugin("parser", function(parser, options) { parser.plugin(/* ... */); });
}); instead. It was called at WebpackSvgStore.apply (C:\Data\webviewer\node_modules\webpack-svgstore-plugin\src\svgstore.js:70:19).

i will try to do as it says and push a PR now

mrsum commented 8 years ago

@nadavsinai will be awesome

nadavsinai commented 8 years ago

ok see #119 I could not resist to make it more modern, and update libs on the way (pug was giving warnings etc)

it means the lib is not compatible with node < 4... you need to remove this from CI if you ask me, but of course choice is yours...

philippkuehn commented 7 years ago

+1

nadavsinai commented 7 years ago

who ever wants to use this today with webpack 2.2 can use my fork at https://github.com/Algotec/webpack-svgstore-plugin until #119 is merged

xeho91 commented 7 years ago

@nadavsinai Does your fork work with Webpack v2.2.1?

I'm getting firstly warning:

webpack: Using compiler.parser is deprecated.Use compiler.plugin("compilation", function(compilation, data) { data.normalModuleFactory.plugin("parser", function(parser, options) { parser.plugin(/ ... /); });}); instead. It was called at WebpackSvgStore.apply (C:\Users\xeho91............\node_modules\webpack-svgstore-plugin\src\svgstore.js:68:19).

And then error:

ERROR in ./src/index.js Module parse failed: C:\Users\xeho91............\node_modules\babel-loader\lib\index.js??ref--11!C:\Users\xeho91............\src\index.js Cannot read property 'properties' of undefined You may need an appropriate loader to handle this file type. TypeError: Cannot read property 'properties' of undefined at Parser.analyzeAst (C:\Users\xeho91............\node_modules\webpack-svgstore-plugin\src\svgstore.js:51:14) at Parser.applyPluginsBailResult1 (C:\Users\xeho91............\node_modules\tapable\lib\Tapable.js:120:27) at C:\Users\xeho91\GitHub.........\node_modules\webpack\lib\Parser.js:671:17 at Parser.enterIdentifier (C:\Users\xeho91............\node_modules\webpack\lib\Parser.js:970:2) at Parser.enterPattern (C:\Users\xeho91............\node_modules\webpack\lib\Parser.js:966:38) at C:\Users\xeho91............\node_modules\webpack\lib\Parser.js:670:12 at Array.forEach (native) at Parser.walkVariableDeclarators (C:\Users\xeho91............\node_modules\webpack\lib\Parser.js:658:14) at Parser.walkVariableDeclaration (C:\Users\xeho91............\node_modules\webpack\lib\Parser.js:631:8) at Parser.walkStatement (C:\Users\xeho91............\node_modules\webpack\lib\Parser.js:434:32) at Parser. (C:\Users\xeho91............\node_modules\webpack\lib\Parser.js:417:9) at Array.forEach (native) at Parser.walkStatements (C:\Users\xeho91............\node_modules\webpack\lib\Parser.js:415:13) at Parser.parse (C:\Users\xeho91............\node_modules\webpack\lib\Parser.js:1145:8) at C:\Users\xeho91............\node_modules\webpack\lib\NormalModule.js:200:17 at C:\Users\xeho91............\node_modules\webpack\lib\NormalModule.js:162:10 @ multi (webpack)-dev-server/client?http://0.0.0.0:8080 webpack/hot/only-dev-server ./index.js

lgordey commented 7 years ago

Ok, don't worry. We'll up the major version soon, in a few days I think.

lgordey commented 7 years ago

Try to use v4.0.0