Skip to content

[Rollup] Cannot read properties of undefined (reading 'url') -- with multiple @use #369

Open
@derrickb

Description

@derrickb

This may be an issue specific to the Rollup plugin, but if sass-embedded is meant to be a drop-in replacement for sass, then it may be an issue worth describing here.

I am using:

"rollup": "^4.39.0",
"rollup-plugin-scss": "^4.0.1",
"sass-embedded": "^1.86.3"

Like this:

import scss from "rollup-plugin-scss";
import * as sassEmbedded from "sass-embedded";
...
scss({
  fileName: "output.css",
  sass: sassEmbedded
}),

And a stripped down test case file that looks like:

@use 'module1';
@use 'module2';

Which results in Cannot read properties of undefined (reading 'url') but only if there is more than one @use statement.

If I swap out sass-embedded for sass, it works without the error, which leads me to think the error lies in this package.

import scss from "rollup-plugin-scss";
import sass from "sass";
...
scss({
  fileName: "output.css",
  sass: sass
}),

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions