Skip to content

Crash when @importing an upstream file with a top level @include that outputs a declaration only when that upstream file @uses another file #2588

@Goodwine

Description

@Goodwine

Example (HRX)

<==> input.scss
.foo {
  @import 'upstream';
}

<==> upstream.scss
@use 'other';

@mixin a() {
  b: c;
}

@include a;

<==> _other.scss
// empty, it doesn't matter

This crashes because evaluate.dart checks for the declaration's "parent's parent". And I guess the reference isn't there.

var siblings = _parent.parent!.children;

Interestingly, this doesn't crash if we...:

  • remove the @use rule
  • replace @use for a built-in module like @use 'sass:math'
  • wrap @include a with &{}
  • remove the wrapping rule .foo{} (it does fail because the delcarataion ends up without a container, but it at least it doesn't crash)

Metadata

Metadata

Assignees

Labels

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions