reworkcss / css

CSS parser / stringifier for Node.js
MIT License
1.58k stars 257 forks source link

Stringify decls is undefined #92

Open jovanovski opened 8 years ago

jovanovski commented 8 years ago

If I try to stringify a generated AST, this is thrown. Some rare cases seem to trigger this, like the CSS linked on this site: http://gmw.cn/ TypeError: Cannot read property 'length' of undefined at Compiler.rule (d:\UvA\Thesis\node\node_modules\css\lib\stringify\identity.js:221:13) at Compiler.visit (d:\UvA\Thesis\node\node_modules\css\lib\stringify\compiler.js:33:25) at Compiler.mapVisit (d:\UvA\Thesis\node\node_modules\css\lib\stringify\compiler.js:45:17) at Compiler.stylesheet (d:\UvA\Thesis\node\node_modules\css\lib\stringify\identity.js:44:15) at Compiler.compile (d:\UvA\Thesis\node\node_modules\css\lib\stringify\identity.js:36:15) at Object.module.exports [as stringify] (d:\UvA\Thesis\node\node_modules\css\lib\stringify\index.js:45:23)

Seems like modifying the code on line 221 in idendity.js seems to fix it: if (!decls|| !decls.length) return '';

webdevelopland commented 2 years ago

2016, wow, and stil no fix