compression-webpack-plugin: TypeError: Invalid non-string/buffer chunk in v0.3 (worked in v0.2).

In the webpack config under plugins.

new CompressionPlugin({    
   test: /\.js$/
})

The regExp was renamed as per the breaking change. But nothing else has changed. The build will succeed in v0.2 but gets the error in v0.3

Stacktrace:

TypeError: Invalid non-string/buffer chunk
    at validChunk (_stream_writable.js:178:14)
    at Gzip.Writable.write (_stream_writable.js:205:12)
    at Gzip.Writable.end (_stream_writable.js:433:10)
    at zlibBuffer (zlib.js:197:10)
    at Object.exports.gzip (zlib.js:123:10)
    at CompressionPlugin.<anonymous> (<Project>/node_modules/compression-webpack-plugin/index.js:68:10)
    at <Project>/node_modules/async/lib/async.js:111:13
    at Array.forEach (native)
    at _each (<Project>/node_modules/async/lib/async.js:32:24)
    at Object.async.each (<Project>/node_modules/async/lib/async.js:110:9)
    at CompressionPlugin.<anonymous> (<Project>/node_modules/compression-webpack-plugin/index.js:55:10)
    at Compilation.applyPluginsAsync (<Project>/node_modules/tapable/lib/Tapable.js:71:13)
    at Compilation.<anonymous> (<Project>/node_modules/webpack/lib/Compilation.js:572:10)
    at Compilation.next (<Project>/node_modules/tapable/lib/Tapable.js:67:11)
    at Compilation.<anonymous> (<Project>/node_modules/webpack/lib/optimize/UglifyJsPlugin.js:137:4)
    at Compilation.applyPluginsAsync (<Project>/node_modules/tapable/lib/Tapable.js:71:13)
    at Compilation.<anonymous> (<Project>/node_modules/webpack/lib/Compilation.js:567:9)
    at Compilation.next (<Project>/node_modules/tapable/lib/Tapable.js:67:11)
    at ExtractTextPlugin.<anonymous> (<Project>/node_modules/extract-text-webpack-plugin/index.js:309:4)
    at Compilation.applyPluginsAsync (<Project>/node_modules/tapable/lib/Tapable.js:71:13)
    at Compilation.<anonymous> (<Project>/node_modules/webpack/lib/Compilation.js:563:8)
    at Compilation.next (<Project>/node_modules/tapable/lib/Tapable.js:67:11)
    at ExtractTextPlugin.<anonymous> (<Project>/node_modules/extract-text-webpack-plugin/index.js:285:5)
    at <Project>/node_modules/extract-text-webpack-plugin/node_modules/async/lib/async.js:52:16
    at Object.async.forEachOf.async.eachOf (<Project>/node_modules/extract-text-webpack-plugin/node_modules/async/lib/async.js:236:30)
    at Object.async.forEach.async.each (<Project>/node_modules/extract-text-webpack-plugin/node_modules/async/lib/async.js:209:22)
    at ExtractTextPlugin.<anonymous> (<Project>/node_modules/extract-text-webpack-plugin/index.js:237:10)
    at Compilation.applyPluginsAsync (<Project>/node_modules/tapable/lib/Tapable.js:71:13)
    at Compilation.seal (<Project>/node_modules/webpack/lib/Compilation.js:525:7)
    at Compiler.<anonymous> (<Project>/node_modules/webpack/lib/Compiler.js:397:15)

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 24 (6 by maintainers)

Most upvoted comments

Fixed in v0.3.1, this could be closed!

@Icehunter “^0.x.y” is special case… just as @cchamberlain said. when the major is “0” the caret makes minor locked.