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

TypeError: Cannot read property 'content' of undefined for "%" unit #389

Closed
montgomery1944 opened this issue May 27, 2015 · 6 comments
Closed

Comments

@montgomery1944
Copy link

When using CSScomb 3.1.5 on LESS:

.test
{
    width: 100%;
}

I am getting exception:

TypeError: Cannot read property 'content' of undefined
    at csscomb\lib\options\unitless-zero.js:28:51
    at Object.Node.forEach (csscomb\node_modules\gonzales-pe\lib\node.js:63:17)
    at module.exports.process (csscomb\lib\options\unitless-zero.js:18:14)
    at Object.Node.map (csscomb\node_modules\gonzales-pe\lib\node.js:111:9)
    at csscomb\node_modules\gonzales-pe\lib\node.js:117:22
    at Array.forEach (native)
    at Object.Node.map (csscomb\node_modules\gonzales-pe\lib\node.js:115:22)
    at csscomb\node_modules\gonzales-pe\lib\node.js:117:22
    at Array.forEach (native)
    at Object.Node.map (csscomb\node_modules\gonzales-pe\lib\node.js:115:22)
@LabEG
Copy link

LabEG commented Jun 2, 2015

I also have this bug.
But if use not default config, (ex. yandex.json, csscomb.json) all good.
Bug only in default (zen.json) config.

@stramel
Copy link

stramel commented Jun 4, 2015

I also am having this issue on 3.1.5 on LESS. Running it through atom-csscomb. Looks to be related to the linked line number but a problem within the first method in gonzales-pe.

https://github.com/csscomb/csscomb.js/blob/master/lib/options/unitless-zero.js#L28

@koistya
Copy link

koistya commented Jun 9, 2015

Having the same issue with LESS files here: kriasoft/react-starter-kit

@koistya
Copy link

koistya commented Jun 9, 2015

Also when this error occurs the content of a LESS file is set to an empty string.

tonyganch added a commit that referenced this issue Jun 9, 2015
@tonyganch
Copy link
Member

The bug was in Gonzales and it's already been fixed in latest version of the parser.
However I cannot update the package dependency because of compatibility issues.
So I've added a hotfix for this issue and released csscomb@3.1.6, please update.

@stramel
Copy link

stramel commented Jun 9, 2015

@tonyganch Thank you kindly! 👍 👏

haoqunjiang pushed a commit that referenced this issue Jan 18, 2016
haoqunjiang added a commit that referenced this issue Jan 18, 2016
haoqunjiang added a commit that referenced this issue Jan 18, 2016
tonyganch added a commit that referenced this issue Jul 11, 2016
tonyganch pushed a commit that referenced this issue Jul 11, 2016
tonyganch pushed a commit that referenced this issue Jul 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants