TypeError: Cannot read property '0' of null
See original GitHub issueHi,
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)
Issue Analytics
- State:
- Created 9 years ago
- Comments:20
Top Results From Across the Web
Cannot read property *0* of null - javascript - Stack Overflow
This means that either you have a typo in your selector or the html or the js gets executed before your element is...
Read more >How To Fix Cannot read Property '0' of Undefined in JS
The Solution · Ensure you are using the correct variable · Perform a simple check on your variable before using it to make...
Read more >Uncaught TypeError: Cannot read property of null - iDiallo
This error occurs when you read a property or call a method on a null object . That's because the DOM API returns...
Read more >Cannot read property 0 or null javascript error.
"can not read property 0" means "lookupfield.getValue()" is null, which means your lookup field may not contians value. About how to use js...
Read more >How to Prevent the Error: Cannot Read Property '0' of Undefined
If a property of an object is an array, it's possible to accidentally misspell the key or try to access the array through...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Found out it was caused by a couple uppercase property names in the css.
@zhouxinkai note this is not valid CSS