-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Variables in detached rulesets not visited by visitor? #3205
Comments
Also exists in |
The error is confirmed; however, the node definitely is visited. Investigating... |
It appears that not only is the variable visited pre-eval in your example, but it also appears to be replacing. I think somehow a copy of the variable is being created in the process of parsing or creating the DR or DR call, then is eval'd separately. @jshado1 Were you using |
@matthew-dean I'm just compiling variable overrides into Semantic-Org/Semantic-UI-LESS; I don't know what they're using. |
@jshado1 Variable overrides.... 🤔 Using a plugin? Why not just set a new value? Are they not globally scoped? |
Some are not globally scoped. Ex |
Okay! I figured out that for some reason, So if someone can help me understand how the Less parser works and addresses that comment, I'll do a PR for this fix. |
@jshado1 They probably just wrap certain vars and mixins like: & {
@scoped-var: value;
}
|
Please review the PR - #3228 |
I have the following plugin
foo.js
and the following Less code
When trying to compile this code using
lessc
and/orless-loader
, Less fails with errorSyntaxError: variable @foo is undefined
.Variables in other contexts (in non-detached rulesets, at top level, in named detached rulests) are visited as expected:
Maybe other node types also affected, but I didn't test it.
Less version: 3.0.2.
The text was updated successfully, but these errors were encountered: