clean-css: TypeError: Cannot read property '0' of null

Hi,

I’m getting an error running v3.1.4 on my css. Attached the output of the error and css file. I’ve not been able to figure out what in the css is causing the issue and has only started happening since updating from an older version.

CSS file: https://www.dropbox.com/s/rdqrz5xx93ksbq5/app.css?dl=0

$ cleancss css/app.css --debug

Inlining local stylesheet: /facetalk/current/fci/css/app.css
Inlining local stylesheet: /facetalk/current/public/fci/fci-js/lib/jplayer/skin/blue.monday/jplayer.blue.monday.css

/facetalk/current/fci/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/properties/extractor.js:50
  return name.replace(/^\-\w+\-/, '').match(/([a-z]+)/)[0];
                                                       ^
TypeError: Cannot read property '0' of null
    at findNameRoot (/facetalk/current/fci/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/properties/extractor.js:50:56)
    at extract (/facetalk/current/fci/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/properties/extractor.js:20:22)
    at AdvancedOptimizer.restructure (/facetalk/current/fci/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/selectors/optimizers/advanced.js:598:22)
    at _optimize (/facetalk/current/fci/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/selectors/optimizers/advanced.js:729:12)
    at AdvancedOptimizer.optimize (/facetalk/current/fci/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/selectors/optimizers/advanced.js:741:3)
    at SelectorsOptimizer.process (/facetalk/current/fci/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/selectors/optimizer.js:15:55)
    at /facetalk/current/fci/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/clean.js:174:31
    at run (/facetalk/current/fci/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/clean.js:153:7)
    at minify (/facetalk/current/fci/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/clean.js:165:3)
    at minifyWithDebug (/facetalk/current/fci/node_modules/grunt-contrib-cssmin/node_modules/clean-css/lib/clean.js:118:10)

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 20

Commits related to this issue

Most upvoted comments

Found out it was caused by a couple uppercase property names in the css.