LESS don't work if has included unrecognized .less file.
We have one file: index.less. If we write in index.less @import ("included.css"); // unrecognized .css file that LESS work correctly. But if write @import("included.less"); // unrecognized .less file that LESS don't work and don't display error.
I test it on LESS 1.4.1 and 1.5.0
Thanks a lot.
less 1.5.0 beta is no longer showing nice error messages for less files it cannot find?
Yes. And not only less 1.5.0, less 1.4.1 too
ok.. well
- are you aware the brackets are wrong in your example? Its
@import "included.less";or@import url("included.less"); - on less2css.org the error appears for me in 1.4.1 http://less2css.org/
I am not use bracket in my project. I made a mistake just in issue
.. and number 2, e.g. I cannot reproduce? browser or node? are you doing anything weird?
I think that what he means is: if you try to include a css-file that doesn't exist, the compiler moves on and just ignores it. If you do the same with a less file, you get an error telling you the file can't be found.
But a css file is kept verbatim and turned into an imort.. so depending on the build process it might be added later? Could warn I suppose.
Ok. i recorded screencast http://youtu.be/x0ZssAHHjZI. Sorry for my English
So, the problem is that when a .less-file is not found, LESS.js does not show an error?
Yes. I think error must be, bacause the strange thing is that everything works with unrecgnized .css
can you reproduce it with your code on less2css.org ? because with simple examples it works, so it must be something in your less file or something wrong with your setup.
Sorry for bad feedback. Download this demo please http://yadi.sk/d/jhGUPRXsAsMZg, because i am not understand how i can reproduce it on less2css.org
I downloaded and tried the demo. Reported issue is that less.js returns an error if imported .less file is not found. Imported css is treated spit out to output as is.
I'm closing the issue, since this is working as it should. Imports of files with .css suffix are assumed to be css imports and less.js keeps them unchanged. Imports of files with .less suffix are assumed to be commands for compiler and files are supposed to be available.
Workaround: if you want an import of .less in the output, use css import directive:
@import (css) "unrecognized.less";
body {
background-color: red;
}
If you want .less compiled if present and kept as is if not present, add +1 to the option import directive https://github.com/less/less.js/issues/2145 which covers that functionality.
Approximate content of of the demo:
If you do following:
@import "unrecognized.css"; // change to unrecognized.css and background will be red
body { background-color: red; }
less.js spits out following:
@import "unrecognized.css";
body {
background-color: red;
}
If you do following:
@import "unrecognized.less"; // change to unrecognized.css and background will be red
body { background-color: red; }
less.js spits out error:
FileError: 'http://localhost:8888/unrecognized.less' wasn't found (404)
in index.less on line 1, column 1:
1@import "unrecognized.less"; // change to unrecognized.css and background will be red
2