dart-sass
dart-sass copied to clipboard
When a module is already loaded, show a stack trace for both the new and original loads
Since adopting the new SASS module system, I have quite often seen an error similar to:
Error: This module was already loaded, so it can't be configured using "with".
┌──> ../../node_modules/@foo/ripple/_variables.scss
55 │ ┌ @forward '@material/ripple/variables' with (
56 │ │ $fade-in-duration: $fade-in-duration !default,
57 │ │ $fade-out-duration: $fade-out-duration !default,
62 │ │ );
│ └─^ new load
╵
┌──> ../../node_modules/@material/ripple/_functions.scss
26 │ @use "./variables";
│ ━━━━━━━━━━━━━━━━━━ original load
╵
@foo/ripple/_variables.scss 55:1 @forward
@foo/ripple/_index.scss 2:1 @use
@foo/button/_index.scss 3:1 @use
@foo/login-form/login-form.scss 4:1 @forward
_index.scss 4:1 root stylesheet
error Command failed with exit code 65.
error Command failed with exit code 65.
This error consists of:
- Description
- Code Snippet for new load
- Code Snippet for original load
- Stack trace for new load code snippet
Improvements that I think could be made:
- It is unclear which code snippet the stack trace is for. In fact, the arrows seem to incorrectly imply that the stack trace belongs to the original load code snippet
- The stack trace is very useful to figure out how the new load happened. But then I'm left with the problem of not understanding where the original load came from when that is the incorrect one. Would it be possible to also display the stack trace for the original load?