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 'line' of undefined #165

Closed
idflood opened this issue Sep 13, 2015 · 1 comment · Fixed by #169
Closed

TypeError: Cannot read property 'line' of undefined #165

idflood opened this issue Sep 13, 2015 · 1 comment · Fixed by #169
Assignees
Labels
Milestone

Comments

@idflood
Copy link

idflood commented Sep 13, 2015

When running gulp-sass-lint on my files I get the following error which seems to happen on the last rule. For exemple if I disable the single-line-per-selector rule the error happen on a different rule.

/project_dir/node_modules/sass-lint/lib/rules/single-line-per-selector.js:20
              'line': next.start.line,
                                ^
TypeError: Cannot read property 'line' of undefined
    at /project_dir/node_modules/sass-lint/lib/rules/single-line-per-selector.js:20:33
    at Node.forEach (/project_dir/node_modules/gonzales-pe/lib/node/basic-node.js:1:2053)
    at /project_dir/node_modules/sass-lint/lib/rules/single-line-per-selector.js:13:16
    at RootNode.traverseByType (/project_dir/node_modules/gonzales-pe/lib/node/root-node.js:1:1739)
    ...

# node --version
v0.12.5

# osx 10.10.5

The error is gone if I change the following line: https://github.com/sasstools/sass-lint/blob/develop/lib/rules/single-line-per-selector.js#L16

if (next && next.start) {

For reference here is a minimal file which cause the error: http://cl.ly/code/1b1o1U1y2q2n
And here the sass-lint.yml: http://cl.ly/code/39022c373X3q

@bgriffith
Copy link
Member

Have a fix for this so I'll get a hotfix up this evening. Thanks for highlighting @idflood

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

Successfully merging a pull request may close this issue.

2 participants