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 '';
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 '';