Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid font-family gets TypeError #15

Open
dy opened this issue Jul 22, 2014 · 1 comment
Open

Invalid font-family gets TypeError #15

dy opened this issue Jul 22, 2014 · 1 comment

Comments

@dy
Copy link

dy commented Jul 22, 2014

I have wrong font-family value: font-family:13px, and cssshrink CLI gets:

/usr/local/lib/node_modules/cssshrink/lib/visitors/font-family-generic.js:28
      var value = node[2][i][1].toLowerCase();
                                ^
TypeError: Object number,13 has no method 'toLowerCase'
    at Object.module.exports.process (/usr/local/lib/node_modules/cssshrink/lib/visitors/font-family-generic.js:28:33)
    at tree (/usr/local/lib/node_modules/cssshrink/node_modules/gonzales-ast/lib/traverse.js:7:20)
    at tree (/usr/local/lib/node_modules/cssshrink/node_modules/gonzales-ast/lib/traverse.js:15:13)
    at tree (/usr/local/lib/node_modules/cssshrink/node_modules/gonzales-ast/lib/traverse.js:15:13)
    at tree (/usr/local/lib/node_modules/cssshrink/node_modules/gonzales-ast/lib/traverse.js:15:13)
    at /usr/local/lib/node_modules/cssshrink/node_modules/gonzales-ast/lib/traverse.js:24:11
    at Array.forEach (native)
    at Object.traverse (/usr/local/lib/node_modules/cssshrink/node_modules/gonzales-ast/lib/traverse.js:23:12)
    at traverseAST (/usr/local/lib/node_modules/cssshrink/lib/shrink.js:50:15)
    at Object.shrink (/usr/local/lib/node_modules/cssshrink/lib/shrink.js:66:9)

It took a while to find out that CSS was invalid. It would be great to log a bit more humanized error messages.

@gijsroge
Copy link

Hehe, just had this error aswel, searched 20 minutes for it. Indeed, a more humanized error would be nice :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants