You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The less/bem/block/file.less and less/color.less files are empty. The content of less/site.less is @import "color";.
The command I ran is yarn less-watch-compiler less css site.less
Something went wrong... What is it?
Actual behavior less-watch-compiler throws an error:
~/s/repro (master|●7+2…) $
yarn less-watch-compiler less css site.less
yarn run v1.22.5
$ /home/filipesilva/sandbox/repro/node_modules/.bin/less-watch-compiler less css site.less
Watching directory for file changes.
internal/fs/utils.js:220
throw err;
^
Error: ENOENT: no such file or directory, stat '/home/filipesilva/sandbox/repro/less/color'
at Object.statSync (fs.js:915:3)
at Object.findLessImportsInFile (/home/filipesilva/sandbox/repro/node_modules/less-watch-compiler/dist/lib/filesearch.js:13:20)
at Object.fileWatcher (/home/filipesilva/sandbox/repro/node_modules/less-watch-compiler/dist/lib/lessWatchCompilerUtils.js:225:38)
at /home/filipesilva/sandbox/repro/node_modules/less-watch-compiler/dist/lib/lessWatchCompilerUtils.js:86:40
at /home/filipesilva/sandbox/repro/node_modules/less-watch-compiler/dist/lib/lessWatchCompilerUtils.js:67:27
at FSReqCallback.oncomplete (fs.js:159:5) {
errno: -2,
syscall: 'stat',
code: 'ENOENT',
path: '/home/filipesilva/sandbox/repro/less/color'
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Expected behavior
Should compile less files successfully.
Desktop (please complete the following information):
OS: Ubuntu 18.04.3 LTS
Additional context
Using the --run-once flag will make it compile sucessfully.
Using the @import "color.less"; will make it compile sucessfully.
Removing the less/bem/block folder and leaving behind an empty less/bem folder will also make it compile sucessfully.
The text was updated successfully, but these errors were encountered:
mhnaeem
pushed a commit
to mhnaeem/deadsimple-less-watch-compiler
that referenced
this issue
Nov 22, 2021
…ion throws ENOENT error
Fixing a bug where .less extension is not optional with some @import statements in certain directory
strcutures. This fix checks if the @import statement has an extension available, if an extension is
not provided we assume the default as .less, related to issue jonycheung#117fixjonycheung#117
Which version are you using (less-watch-compiler --version to find out)? 1.14.6
Is the issue reproducible after updating to the latest version ( npm update less-watch-compiler)? yes
Describe the bug
The LESS docs say that the
.less
extension is optional on imports.But
less-watch-compiler
will throw an exception when it encounters such imports under very specific circumstances:less-watch-compiler
is ran on watch modeTo Reproduce
Steps to reproduce the behavior:
The
less/bem/block/file.less
andless/color.less
files are empty. The content ofless/site.less
is@import "color";
.yarn less-watch-compiler less css site.less
Actual behavior
less-watch-compiler
throws an error:Expected behavior
Should compile less files successfully.
Desktop (please complete the following information):
Additional context
Using the
--run-once
flag will make it compile sucessfully.Using the
@import "color.less";
will make it compile sucessfully.Removing the
less/bem/block
folder and leaving behind an emptyless/bem
folder will also make it compile sucessfully.The text was updated successfully, but these errors were encountered: