webpack-contrib / purifycss-webpack

UNMAINTAINED, use https://github.com/FullHuman/purgecss-webpack-plugin
MIT License
772 stars 37 forks source link

TypeError: Cannot read property 'node' of undefined #112

Open IAMtheIAM opened 7 years ago

IAMtheIAM commented 7 years ago

Using "purifycss-webpack": "0.7", and "webpack": "2.6.1",

When Compiling with these options

      new PurifyCSSPlugin({
         // Give paths to parse for rules. These should be absolute!
         paths: _.union(templatesPath, componentsPath), // this concats two or more array globs together into one array
         moduleExtensions: ['.html'],
         verbose: true,
         purifyOptions: {
            minify: true,
            info: true,
            output: helpers.root(outputDir) + '/css/purified',
            rejected: false,
            whitelist: // KendoUI for jQuery - classes that are programatically added to DOM, therefore must be whitelisted since they cannot be evaluated during compile-time

            // '*selector*' means any class which contains that selector.
               [" 
              // whitelist styles here
               "]
         }
      }),

I suddenly get this error:

    ________________________________________________
    |
    |   PurifyCSS has reduced the file size by ~ 52.4%  
    |
    ________________________________________________

Assets to purify: 

C:\Source\frontend\node_modules\purifycss-webpack\node_modules\webpack-sources\lib\ConcatSource.js:39
    var node = new SourceNode(null, null, null, this.children.map(function(item) {
                                                           ^
TypeError: Cannot read property 'node' of undefined
    at C:\Source\frontend\node_modules\purifycss-webpack\node_modules\webpack-sources\lib\ConcatSource.js:40:48
    at Array.map (native)
    at ConcatSource.node (C:\Source\frontend\node_modules\purifycss-webpack\node_modules\webpack-sources\lib\ConcatSource.js:39:60)
    at ConcatSource.proto.sourceAndMap (C:\Source\frontend\node_modules\purifycss-webpack\node_modules\webpack-sources\lib\SourceAndMapMixin.js:28:18)
    at C:\Source\frontend\node_modules\webpack\lib\SourceMapDevToolPlugin.js:65:35
    at Array.map (native)
    at C:\Source\frontend\node_modules\webpack\lib\SourceMapDevToolPlugin.js:52:85
    at Array.forEach (native)
    at Compilation.<anonymous> (C:\Source\frontend\node_modules\webpack\lib\SourceMapDevToolPlugin.js:51:12)
    at Compilation.applyPlugins1 (C:\Source\frontend\node_modules\tapable\lib\Tapable.js:75:14)
    at self.applyPluginsAsync.err (C:\Source\frontend\node_modules\webpack\lib\Compilation.js:639:11)
    at next (C:\Source\frontend\node_modules\tapable\lib\Tapable.js:138:11)
    at Compilation.compilation.plugin (C:\Source\frontend\node_modules\webpack\lib\optimize\UglifyJsPlugin.js:230:5)
    at Compilation.applyPluginsAsyncSeries (C:\Source\frontend\node_modules\tapable\lib\Tapable.js:142:13)
    at self.applyPluginsAsync.err (C:\Source\frontend\node_modules\webpack\lib\Compilation.js:635:10)
    at next (C:\Source\frontend\node_modules\tapable\lib\Tapable.js:138:11)
    at Compilation.<anonymous> (C:\Source\frontend\node_modules\purifycss-webpack\dist\index.js:102:11)
    at next (C:\Source\frontend\node_modules\tapable\lib\Tapable.js:140:14)
    at ExtractTextPlugin.<anonymous> (C:\Source\frontend\node_modules\extract-text-webpack-plugin\index.js:341:4)
    at Compilation.applyPluginsAsyncSeries (C:\Source\frontend\node_modules\tapable\lib\Tapable.js:142:13)
    at sealPart2 (C:\Source\frontend\node_modules\webpack\lib\Compilation.js:631:9)
    at next (C:\Source\frontend\node_modules\tapable\lib\Tapable.js:138:11)
    at ExtractTextPlugin.<anonymous> (C:\Source\frontend\node_modules\extract-text-webpack-plugin\index.js:313:5)
    at C:\Source\frontend\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:460:16
    at iteratorCallback (C:\Source\frontend\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:1034:13)
    at C:\Source\frontend\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:944:16
    at C:\Source\frontend\node_modules\extract-text-webpack-plugin\index.js:297:6
    at C:\Source\frontend\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:460:16
    at eachOfArrayLike (C:\Source\frontend\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:1027:9)
    at eachOf (C:\Source\frontend\node_modules\extract-text-webpack-plugin\node_modules\async\dist\async.js:1087:5)
galvarez421 commented 6 years ago

I also received this same error after assigning a value to the output property.