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 'start' of undefined for Sass for insude Vue #4373

Closed
akoidan opened this issue Oct 23, 2019 · 2 comments
Closed

Comments

@akoidan
Copy link

akoidan commented Oct 23, 2019

Clearly describe the bug

The sass loops inside of VUE files cause linter to crash

Which rule, if any, is the bug related to?

not related to any rule

What CSS is needed to reproduce the bug?

Any rule that has @for loop in sass

  $class-slug: for !default

  @for $i from 1 through 4
    .#{$class-slug}-#{$i}
      width: 60px + $i
      color: black

What stylelint configuration is needed to reproduce the bug?

Any rule, is not rule specific. Put something to tigger the linter.

{
  "rules": {
    "color-named": "never"
  }
}

Which version of stylelint are you using?

11.1.1

How are you running stylelint: CLI, PostCSS plugin, Node.js API?

./node_modules/.bin/stylelint Sass.vue

Does the bug relate to non-standard syntax (e.g. SCSS, Less etc.)?

Yes, it's related to SASS loops

What did you expect to happen?

stylelint would work instead of failing with an error

What actually happened (e.g. what warnings or errors did you get)?

An error occured

TypeError: Cannot read property 'start' of undefined
    at LocalFixer.node (/home/andrew/sass-for/node_modules/postcss-syntax/parse-style.js:35:27)
    at /home/andrew/sass-for/node_modules/postcss-syntax/parse-style.js:41:9
    at /home/andrew/sass-for/node_modules/postcss/lib/container.js:135:18
    at Root.each (/home/andrew/sass-for/node_modules/postcss/lib/container.js:101:16)
    at Root.walk (/home/andrew/sass-for/node_modules/postcss/lib/container.js:131:17)
    at LocalFixer.root (/home/andrew/sass-for/node_modules/postcss-syntax/parse-style.js:40:8)
    at LocalFixer.parse (/home/andrew/sass-for/node_modules/postcss-syntax/parse-style.js:69:9)
    at parseStyle (/home/andrew/sass-for/node_modules/postcss-syntax/parse-style.js:88:39)
    at /home/andrew/sass-for/node_modules/postcss-syntax/parse-style.js:103:17
    at Array.forEach (<anonymous>)

To reproduce the issue:

@hudochenkov
Copy link
Member

Thanks for the report and for using the template.

It's a problem with postcss-sass parser. Here the demo with Sass syntax failing.

Please, open an issue in postcss-sass.

@akoidan
Copy link
Author

akoidan commented Oct 23, 2019

Forwaded to AleshaOleg/postcss-sass#120

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

No branches or pull requests

2 participants