-
Notifications
You must be signed in to change notification settings - Fork 350
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
[email protected] breaks optional parameters for functions? #2059
Comments
Same here, we've returned to 1.64.2 for the moment |
ugrade v1.65.1, and output: "Error: 2 arguments required, but only 1 was passed." |
The upgrade to v1.65.1 throws "Error: 2 arguments required, but only 1 was passed.". We currently locked the version to v1.64.2 to fix the issue. |
homebrew can not reinstall [email protected] 🥵 |
CHANGELOG of 1.65.0:
It looks like because this is implemented as css syntax parser, it will no longer be parsed as a sass function if you have one with the same name. Rename sass function |
Thanks, I totally missed that |
@ntkme but why can't I use the name e.g. @function _rem($value) {
@return (math.div($value, 16px)) * 1rem
}
.test {
font-size: _rem(32px);
} |
@sqal The following works normally for me. Maybe you have other code that is triggering the error?
It outputs:
|
@ntkme decided to rename to // mixins.scss @use "sass:math";
// the name can be anything as long as it starts with underscore
@function _rem($value) {
@return (math.div($value, 16px)) * 1rem
} input.scss @use "./mixins.scss" as *; // (!) imported from another file
$size: _rem(16px);
.test {
width: $size * 2;
} result:
|
@sqal Functions prefixed with underscore are considered "private members": https://sass-lang.com/documentation/at-rules/use/#private-members
|
An alternative is not loading the mixin without a namespace (i.e. not using |
Should
|
I've reopened sass/sass#3504 to track this. |
I've been using a rem function mixin basically exactly like mewan7's for YEARS and just today ran into this and was getting very confused and frustrated. I'm going to try rolling back to v1.64.x I guess but that's not going to be sustainable in the long term. EDIT: Basically, if you were coding while sleepy and forgot to actually |
Hello, I recently ran into this and thought I'd report it in case someone else runs into it.
We have a function we've been using such as this one:
When we upgraded to [email protected] using this function like this:
Throws this error:
This works fine in 1.64.x
You can see this in action here: https://stackblitz.com/edit/vitejs-vite-xuicb1?file=src%2FApp.scss
I checked the changelog and didn't see anything related to this. I haven't had time to look into what may have caused this, but I'll take a look in a few to see if I can identify what happened.
The text was updated successfully, but these errors were encountered: