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 'content' of undefined when @extend from external file #396

Closed
itsimoshka opened this issue Nov 12, 2015 · 5 comments
Closed
Labels

Comments

@itsimoshka
Copy link

Sass-lint crashes when encounter @extend from external file.
For example I use PureCSS, and

.test
  @extend .pure-u-1-6

In this case I get Cannot read property 'content' error

@bgriffith
Copy link
Member

Can you give us the whole error please? So we can see which rule is causing the issue.

@itsimoshka
Copy link
Author

mixin-name-format.js:25
        name = node.first('simpleSelector').first('ident').content;
                                                          ^

TypeError: Cannot read property 'content' of undefined
    at C:\Users\its\AppData\Roaming\npm\node_modules\sass-lint\lib\rules\mixin-name-format.js:25:59
    at RootNode.traverseByType (C:\Users\its\AppData\Roaming\npm\node_modules\sass-lint\node_modules\gonzales-pe\lib\node\root-node.js:1:1739)
    at RootNode.traverseByTypes (C:\Users\its\AppData\Roaming\npm\node_modules\sass-lint\node_modules\gonzales-pe\lib\node\root-node.js:1:1937)
    at Object.module.exports.detect (C:\Users\its\AppData\Roaming\npm\node_modules\sass-lint\lib\rules\mixin-name-format.js:16:9)
    at C:\Users\its\AppData\Roaming\npm\node_modules\sass-lint\index.js:44:27
    at Array.forEach (native)
    at Function.sassLint.lintText (C:\Users\its\AppData\Roaming\npm\node_modules\sass-lint\index.js:43:11)
    at C:\Users\its\AppData\Roaming\npm\node_modules\sass-lint\index.js:91:21
    at Array.forEach (native)
    at Function.sassLint.lintFiles (C:\Users\its\AppData\Roaming\npm\node_modules\sass-lint\index.js:90:9)

@bgriffith
Copy link
Member

Awesome thanks. Managed to replicate.

@itsimoshka
Copy link
Author

@bgriffith now I see that problem is in name, but why I can't extend class?

@bgriffith
Copy link
Member

There's a bug that's assuming a certain node exists. You should be able to extend classes. We'll hotfix this.

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

No branches or pull requests

2 participants