Skip to content

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

Closed
@timbru31

Description

@timbru31
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions