Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quiet-deps isn't quieting dependencies #1360

Closed
jdelStrother opened this issue Jun 15, 2021 · 13 comments · Fixed by #1362
Closed

quiet-deps isn't quieting dependencies #1360

jdelStrother opened this issue Jun 15, 2021 · 13 comments · Fixed by #1362

Comments

@jdelStrother
Copy link

jdelStrother commented Jun 15, 2021

In this sample project, if I run yarn sass --load-path=./node_modules --quiet-deps ./style.scss, I get deprecation warnings from Bootstrap - eg:


$ yarn sass --load-path=./node_modules --quiet-deps ./style.scss

Deprecation Warning: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($spacer, 2)

More info and automated migrator: https://sass-lang.com/d/slash-div

    ╷
302 │ $headings-margin-bottom:      $spacer / 2 !default;
    │                               ^^^^^^^^^^^
    ╵
    bootstrap/scss/_variables.scss 302:31  @import
    style.scss 2:9                         root stylesheet

From a debugger I can see that in here -

    _warn$3$deprecation: function(message, span, deprecation) {
      var _this = this;
      if (_this._quietDeps && _this._inDependency)
        return;
      if (!_this._warningsEmitted.add$1(0, new S.Tuple2(message, span, type$.Tuple2_String_SourceSpan)))
        return;
      _this._evaluate$_logger.warn$4$deprecation$span$trace(0, message, deprecation, span, _this._evaluate$_stackTrace$1(span));
    },

_this._quietDeps is true and _this._inDependency is false, but I'm struggling to figure out why bootstrap/scss/_variables.scss might not be considered a dependency.

@cedx
Copy link

cedx commented Jun 15, 2021

Same issue here: the --quiet-deps flag worked as expected with Sass v1.34.1, but after upgrading to v1.35.0 it doesn't work anymore.

@strarsis
Copy link

+1, just noticed the same thing after updating sass to 1.35.0.
The quietDeps option is passed - but apparently sass is unable to correctly determine what files are deps to be skipped.

@jdelStrother
Copy link
Author

Thanks @nex3 !

@alexbuznik-stark
Copy link

Happening to me on 1.80.3

@nex3
Copy link
Contributor

nex3 commented Oct 30, 2024

Happening to me on 1.80.3

Can you file a separate issue with a reproduction?

@Aetherinox
Copy link

also getting it on 1.83.0

      loader: 'sass-loader',
      options: {
          sassOptions: {
              outputStyle: 'expanded',
              quietDeps: true
          },
          sourceMap: !devMode
      }

@nex3
Copy link
Contributor

nex3 commented Dec 14, 2024

@Aetherinox Same request as before, please file a separate issue with a stand-alone reproduction.

@raph5
Copy link

raph5 commented Dec 31, 2024

Got the same issue in 1.80.0 and later versions with darken and transparentize

Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
Use color.adjust instead.

More info and automated migrator: https://sass-lang.com/d/import

    ╷
111 │     background-color: transparentize(darken($primary, 60), 0.5);
    │                                      ^^^^^^^^^^^^^^^^^^^^
    ╵
    file:///home/raph/code/eve-market-browser/apps/website/scss/ui.scss 111:38  root stylesheet

It think this exemple will reproduce the issue

body {
  background-color: darken(white, 0);
}

I downgraded to sass 1.79.6 as a workaround and don't have the warnings anymore

@nex3
Copy link
Contributor

nex3 commented Jan 2, 2025

@raph5 In order to understand why --quiet-deps isn't working how you expect, we need more than just a code snippet. --quiet-deps affects depenencies loaded through importers, so we'd need to know how you're loading the dependency you expect to be silenced.

@raph5
Copy link

raph5 commented Jan 3, 2025

Im using @ import. But actually I think this not related to the --quiet-deps flag the deprecation warning still appears without importing anything:

~ echo "p { color: darken(white, 0) }" | sass --stdin --silence-deprecation import,color-functions --quiet-deps

Deprecation Warning: Global built-in functions are deprecated and will be removed in Dart Sass 3.0.0.
Use color.adjust instead.

More info and automated migrator: https://sass-lang.com/d/import

  ╷
1 │ p { color: darken(white, 0) }
  │            ^^^^^^^^^^^^^^^^
  ╵
    - 1:12  root stylesheet

p {
  color: white;
}

This may be related to #2418

@jdelStrother
Copy link
Author

@raph5 Try this:

$ echo "p { color: darken(white, 0) }" | sass  --stdin --silence-deprecation color-functions,global-builtin
p {
  color: white;
}

(It would help if sass made it clearer exactly which deprecation it was warning about - it does say Global built-in functions are deprecated, but it's sometimes not obvious how to get from that to the exact deprecation-label you want to silence)

@nex3
Copy link
Contributor

nex3 commented Jan 4, 2025

@jdelStrother That's a good point, I've put out #2475 to fix that.

@jdelStrother
Copy link
Author

Nice, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants