-
Couldn't load subscription status.
- Fork 370
Closed
Description
I ran into a Sass compiler error recently with a combination of lists and maps.
What I have is a list containing a number of maps. This works without any problems until I only have a single map in that list.
At that point Sass requires a trailing comma after the list item, otherwise it will not be recognized as a map:
@use "sass:map";
@use "sass:list";
$list-of-maps: (
(
"key": "value"
)
);
$list-item: list.nth($list-of-maps, 1);
$value: map.get($list-item, "key");This produces the following error:
Error: $map: "key" "value" is not a map.
However, the code compiles correctly if a trailing comma is added after the list item:
@use "sass:map";
@use "sass:list";
$list-of-maps: (
(
"key": "value"
- )
+ ),
);
$list-item: list.nth($list-of-maps, 1);
$value: map.get($list-item, "key");I have created a minimal reproduction repo here.
Metadata
Metadata
Assignees
Labels
No labels