Skip to content

Crash when parsing nested at rules (@import in media query) #103

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

Closed
timbru31 opened this issue Apr 23, 2018 · 2 comments · Fixed by #113
Closed

Crash when parsing nested at rules (@import in media query) #103

timbru31 opened this issue Apr 23, 2018 · 2 comments · Fixed by #113

Comments

@timbru31
Copy link

  • Node Version: v8.11.1
  • NPM Version: v5.6.0
  • postcss-less Version: v1.1.5

LESS

@media screen {
	@import "basic";
}

JavaScript

n/a

Errors

TypeError: this[node.type] is not a function
    at Stringifier.stringify (/Users/timbru/work/ume/door-to-door-webapp/node_modules/postcss-less/node_modules/postcss/lib/stringifier.js:33:24)
    at Stringifier.body (/Users/timbru/work/ume/door-to-door-webapp/node_modules/postcss-less/node_modules/postcss/lib/stringifier.js:93:18)
    at Stringifier.block (/Users/timbru/work/ume/door-to-door-webapp/node_modules/postcss-less/node_modules/postcss/lib/stringifier.js:103:18)
    at Stringifier.atrule (/Users/timbru/work/ume/door-to-door-webapp/node_modules/postcss-less/node_modules/postcss/lib/stringifier.js:74:18)
    at Stringifier.stringify (/Users/timbru/work/ume/door-to-door-webapp/node_modules/postcss-less/node_modules/postcss/lib/stringifier.js:33:24)
    at stringify (/Users/timbru/work/ume/door-to-door-webapp/node_modules/postcss-less/node_modules/postcss/lib/stringify.js:14:9)
    at AtRule.toString (/Users/timbru/work/ume/door-to-door-webapp/node_modules/postcss-less/node_modules/postcss/lib/node.js:197:9)
    at check (/Users/timbru/work/ume/door-to-door-webapp/node_modules/stylelint/lib/rules/block-closing-brace-empty-line-before/index.js:58:41)
    at /Users/timbru/work/ume/door-to-door-webapp/node_modules/postcss-less/node_modules/postcss/lib/container.js:296:28
    at /Users/timbru/work/ume/door-to-door-webapp/node_modules/postcss-less/node_modules/postcss/lib/container.js:148:26

Expected Behavior

Parsing should work.

Actual Behavior

Parsing crashes.

How can we reproduce the behavior?

npx stylelint --syntax less '{src,styleguide}/**/*.less' with the example less above.
PS: I am not sure if this is an upstream (postcss) issue or related to the postcss-less parsing.

@shellscape
Copy link
Owner

Hard to say who's the culprit here. First stop should be stylelint if you're not interested in submitting a PR to fix the issue. those folks are usually quick to patch something like this.

@shellscape shellscape mentioned this issue Sep 17, 2018
16 tasks
@shellscape
Copy link
Owner

Good news: this is resolved by the work done in #113

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

Successfully merging a pull request may close this issue.

2 participants