-
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
Plugin loading fails when using syncImport #3294
Comments
This certainly sounds like a bug, but just curious, why are you using |
@matthew-dean I'm not specificly using EDIT: on second though, you might be more interested in the conext. I'm building a build tool for our web applications. The tool, for now, only has a simple callback per build step. So each step needs to be finished when the callback ends. So loading stuff async isn't really an option. |
BTW, I can provide a fix to solve this issue, I just could not make sense of the tests to provide a regression test. If you are willing to help me with the test, I'm happy to provide a PR for this issue. |
@yannickl88 Yep, I could probably help with tests. In general, the So, if in your PR, you added a If it changes output, you'll need to update the |
Thanks! I will have a look tomorrow when I'm back in the office. I don't have my change here on this PC. If I need any help, I'll let you know. |
hmm, I've added a regression test. However, my 'fix' does not appear to be sync enough. Which looks like it might be doing something async further on. My Changes: master...yannickl88:fix/3294 I suspect it has something to do with https://github.com/less/less.js/blob/master/lib/less/import-manager.js#L41 which does not return anything. |
Loading a plugin fails when less is using the
syncImport
option. The File manager seems to return the result instead of a promise in this case. It can be easily reproduced with the following code:Example:
Error:
Code that is causing it:
https://github.com/less/less.js/blob/master/lib/less-node/file-manager.js#L42
The text was updated successfully, but these errors were encountered: