question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: Cannot read property '0' of null

See original GitHub issue

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)

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
bostondvcommented, Mar 4, 2015

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

0reactions
jakubpawlowiczcommented, Jan 23, 2017

@zhouxinkai note this is not valid CSS

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found