I dont know why toRemove return undefined
See original GitHub issueat
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:
- Created 7 years ago
- Reactions:1
- Comments:9
Top 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 >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
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)
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.