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
Extension required in node_modules #3115
Comments
Also ran into this issue today. |
I confirm this issue also. You can reproduce it cloning and running npm run dev on this repo: https://github.com/acacha/AdminLTETinkerLaravelMix Take into account that this is maybe a webpack issue because using lessc command there are no problems. |
@acacha I did think the same thing but I have proved otherwise.. if you see the repo I created in the issue raised... you can see it's not using webpack & we do still have this issue :( |
I did have a dig around in the less source code & this looked likely a place to start testing some things out: less.js/lib/less-node/file-manager.js Lines 79 to 87 in 55380d4
I'm reluctant to start digging or making a PR until I know this is isn't intended behaviour... if one of the maintainers of Less can confirm... I'm happy to investigate a fix. |
@robhuzzey Importing from node_modules was only added to the last 3.0 alpha, and no it's not intended behaviour that it wouldn't import without |
@matthew-dean I seem to have fixed it with this work: https://github.com/robhuzzey/less.js/tree/issue3115_extInNodePath but am unclear on where to add a test for this? All the tests pass with this change... I'm happy to submit the PR for review / suggestions? |
@robhuzzey You would need to add a |
Thanks @matthew-dean I did verify the current tests broke before putting in the fix... where I struggle is that all the tests were named I guess the next challenge is getting it to include a file from |
@robhuzzey Would you also have time to look at #3116 ? That's fine if you don't. |
@matthew-dean sure... happy to help out. I made a test for my branch here: https://github.com/robhuzzey/less.js/tree/issue3115_extInNodePath but something appears to not work as I expected (I think I don't fully understand how to include a test for this work). If you can point me as to what I'm doing wrong, I would appreciate it :) |
Sorry @matthew-dean I'm working abroad at the moment so on a different timezone now... happy to look at the issues you have if you can let me know how to write tests for this lib? I've tried a few times periodically but feel like it's probably something obvious you can tell me with ease :) |
@robhuzzey I'm not familiar with the |
@matthew-dean thank you... it was so simple in the end.. just needed the CSS to compare! I didn't know about I've made the PR now: #3120 I'm not sure of best description... if you have examples I can follow etc or a template I will gladly follow it. Thanks. |
This issue has been resolved by: #3120 |
@robhuzzey Any timeline on when a new Alpha will be released with this fix? This currently breaks my webpack build when I try to override variables in an external library. |
@stefan-schweiger I'm going to try to release this either tonight or tomorrow night. |
If anyone is interested in getting involved in Releasing for the Less repo, by all means contact me here or on Twitter @matthewdeaners. |
@stefan-schweiger sorry, only just seen this. I've not got the ability to release like Matthew Dean has (this is my first contribution to Less to be honest). @matthew-dean as you can probably tell, I'm quite busy at the moment but I have some scheduled "down time" coming up soon so I will come back to you then if that's ok? (I just cannot add more to what I'm currently doing right now). |
thanks @matthew-dean for fixing #3123, that's the reason I even got this error in my release build. So don't worry @robhuzzey it worked out by downgrading manually for before this was fixed. |
This problem still persisted in the release 3.0.1. |
@allentcm That doesn't make sense. Less 2.7.3 doesn't import from the node_modules folder at all. |
@matthew-dean @allentcm downgrading to 2.7.3 worked for me as well |
@matthew-dean @allentcm @babsonmatt downgrading to 2.7.3 worked for me , too 👍 |
I've been trying to replicate an issue today & finally I have something by hacking around in my
node_modules
directory.Basically, including a LESS file without an extension works, we know this... but... including without an extension from a
node_modules
directory fails.I've created a simple repo demonstrating the following: https://github.com/robhuzzey/lessimporttest
@import './one/two/three/four/test';
worksas does:
@import 'thisisinnodemodules/one/two/three/four/test.less';
(note that's including from node_modules with an extension)
However:
@import 'thisisinnodemodules/one/two/three/four/test';
(note that's including from node_modules without extension)
does not work and yields the following error:
I've made a couple of branches to show this appears to be an issue with
v3
but NOTv2
... can anybody confirm if this is expected or undesired behaviour (I can't seem to find anything about this online).The text was updated successfully, but these errors were encountered: