-
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
processImports set to false and using @import results in TypeError: Cannot read property 'rules' of undefined #3504
Comments
Can you do a PR with a test case that fails in 3.11.1 and succeeds with your PR? |
@matthew-dean I've checked and the error no longer occurs, but now the whole imports are gone. In v2 the import would be reflected in the output (instead of processing it). Do you want me to create a new issue for that? |
@vandernorth Damn it, I must not have written the appropriate test. No, let's re-open this one. [sigh] |
@vandernorth Hang on, are you speaking of this, which is fixed? #3508 OR are you saying it's empty with |
I'm trying to figure out what the intended behavior of So, can you point to where you found this option documented, how you are you using it, and how you expect this to function in regards to output? |
@matthew-dean I'm not sure where I've found this options. Must have been from an example or StackOverflow answer like this one. The reason we need/use this option is because we allow users to create their own LESS and we parse it for them, server-side. The normal behavior will allow things like Setting I hope this answers your question, if you have any additional questions, let me know! |
@vandernorth In that case, I think it needs a PR with proper tests? |
@vandernorth So, in diving into the codebase for the last month, it appears like processImports is simply an option set by the import visitor to not create duplicate visitors, and that it's not actually a supported option. |
I've looked through the issues, but couldn't find something similar. The below code used to work in less 2.x.
When trying this with less 3.11.1 it fails with
TypeError: Cannot read property 'rules' of undefined
on the following less-code fromless.cjs.js
:this.root
seems to beundefined
. I'm just wondering if it's something I did wrong on my end or that it's a bug we can fix?Setting processImports to true > Ok
Adding more css/less > Same error.
Managed to fix it by changing the less code to
But I'm not sure if that's the best approach here, there might be an underlying bug somewhere.
The text was updated successfully, but these errors were encountered: