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

Cannot read property \'replace\' of undefined\n at ieInlineBlockHack #46

Open
CopyJosh opened this issue Jun 22, 2016 · 1 comment
Open

Comments

@CopyJosh
Copy link

I am getting this error when running cssgrace, on the PostCSS 5.0.21

[19:44:21] { [TypeError: Cannot read property 'replace' of undefined] name: 'TypeError', message: 'Cannot read property \'replace\' of undefined', stack: 'TypeError: Cannot read property \'replace\' of undefined\n at ieInlineBlockHack (/home/vagrant/Sites/pagekit/node_modules/cssgrace/lib/index.js:323:36)\n at /home/vagrant/Sites/pagekit/node_modules/cssgrace/lib/index.js:470:5\n at /home/vagrant/Sites/pagekit/node_modules/postcss/lib/container.js:94:28\n at /home/vagrant/Sites/pagekit/node_modules/postcss/lib/container.js:81:26\n at Rule.each (/home/vagrant/Sites/pagekit/node_modules/postcss/lib/container.js:68:22)\n at Rule.walk (/home/vagrant/Sites/pagekit/node_modules/postcss/lib/container.js:80:21)\n at Rule.walkDecls (/home/vagrant/Sites/pagekit/node_modules/postcss/lib/container.js:92:25)\n at cssgraceRule (/home/vagrant/Sites/pagekit/node_modules/cssgrace/lib/index.js:468:8)\n at /home/vagrant/Sites/pagekit/node_modules/postcss/lib/container.js:118:28\n at /home/vagrant/Sites/pagekit/node_modules/postcss/lib/container.js:81:26', fileName: '/home/vagrant/Sites/pagekit/packages/standardtextile/theme-stc/process/css/theme.css', showStack: true, showProperties: true, plugin: 'gulp-postcss' }

The error appears to be with this line:

https://github.com/cssdream/cssgrace/blob/master/lib/index.js#L323

Which is throwing an error when decl.raws.before is "undefined"...

However, undefined is a permitted state for that variable. It should be checked if the variable is undefined.

@gucong3000
Copy link
Contributor

@CopyJosh maybe same with #45

Try my branch npm i gucong3000/cssgrace

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