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.

I dont know why toRemove return undefined

See original GitHub issue

at

https://github.com/jakubpawlowicz/clean-css/blob/master/lib/properties/optimizer.js#L133

i fix with:

if ( typeof(toRemove) != 'undefined') {
    var longhandToShorthand = toRemove.name != _name;
} else {    
 continue;
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:9

github_iconTop GitHub Comments

1reaction
acidjazzcommented, Nov 1, 2016

confirmed w/ v6.9.1

/Users/k/256/node_modules/clean-css/lib/properties/optimizer.js:134 var longhandToShorthand = toRemove.name != _name; ^

TypeError: Cannot read property ‘name’ of undefined at _optimize (/Users/k/256/node_modules/clean-css/lib/properties/optimizer.js:134:43) at optimize (/Users/k/256/node_modules/clean-css/lib/properties/optimizer.js:198:3) at recursivelyOptimizeProperties (/Users/k/256/node_modules/clean-css/lib/selectors/advanced.js:51:9) at optimize (/Users/k/256/node_modules/clean-css/lib/selectors/advanced.js:61:3) at minify (/Users/k/256/node_modules/clean-css/lib/clean.js:228:5) at whenSourceMapReady (/Users/k/256/node_modules/clean-css/lib/clean.js:135:7) at Object.whenDone (/Users/k/256/node_modules/clean-css/lib/clean.js:155:14) at processNext (/Users/k/256/node_modules/clean-css/lib/imports/inliner.js:105:13) at importFrom (/Users/k/256/node_modules/clean-css/lib/imports/inliner.js:79:10) at ImportInliner.process (/Users/k/256/node_modules/clean-css/lib/imports/inliner.js:38:10) at /Users/k/256/node_modules/clean-css/lib/clean.js:120:41 at _combinedTickCallback (internal/process/next_tick.js:67:7) at process._tickCallback (internal/process/next_tick.js:98:9)

1reaction
analytikcommented, Sep 20, 2016

Seems to work in Node.js v4.4.x, but is broken in 6.0, 6.5, 6.6 and possibly others. Tested on Windows 10 x64 and Debian x64.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Return undefined on Array.map - javascript - Stack Overflow
Use the Array.filter method after Array.map to remove undefined ... above will no longer result in undefined elements within the new array.
Read more >
row().data() returns undefined with the correct data followed ...
Hi, I'm having a weird issue on getting row().data(), where after reinitialization of the table, it would return undefined first, ...
Read more >
Why does the getElementsByTagName return undefined ...
I'm trying to pick three tag values from the HTML by using the getElementsByTagName, assign them to an array called getItems and assign...
Read more >
Why returning undefined in array as output? - JavaScript
The function supplied to it expects you to explicitly return a value during each iteration to be assigned to the same index in...
Read more >
7 Tips to Handle undefined in JavaScript - Dmitri Pavlutin
A detailed article about 'undefined' keyword in JavaScript. 7 tips on how to handle correctly 'undefined' and increase code durability.
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