Comments (3)
@serjp which version of less-watch-compiler
Could you try the latest?
from deadsimple-less-watch-compiler.
@jonycheung [email protected]
, the latest in npm. Tried version 1.6.13 - seems to be ok.
from deadsimple-less-watch-compiler.
I am experiencing the same problem with every version > 1.4
(1.4.2
works ok).
Just set the watchFolder
to be relative:
./less
../src/less
(in my case)
and the exception is thrown.
Debugging the code of the latest version (1.10
) I encountered the following code in lessWatchCompilerUtils.js:184
:
fileWatcher: function fileWatcher(f, files, options, filelist, fileimportlist, watchCallback) {
if (filelist.indexOf(f) !== -1) return;
filelist[filelist.length] = f;
if (f.indexOf('.') !== -1) {
fileimportlist[f] = fileSearch.findLessImportsInFile(f);
}
lessWatchCompilerUtilsModule.setupWatcher(f, files, options, watchCallback);
for (var i in fileimportlist[f]) {
if (filelist.indexOf(fileimportlist[f][i]) === -1) {
lessWatchCompilerUtilsModule.setupWatcher(path.normalize(path.dirname(f) + '/' + fileimportlist[f][i]), files, options, watchCallback);
}
}
}
this function is called (probably the first time) with f
set to the watchFolder
and the second if
(if (f.indexOf('.') !== -1)
) will resolve to true
if f
has .
inside it (and every relative folder name does) calling fileSearch.findLessImportsInFile(f)
which will fail by calling fs.readFileSync(f, 'utf8')
in filesearch.js:15
.
The condition if (f.indexOf('.') !== -1)
if pretty fragile one. Why not checking if f
is a directory?
Changing the condition to if (f.lastIndexOf('.') > 2)
solves the problem for me, but it's a hack.
Thank you.
from deadsimple-less-watch-compiler.
Related Issues (20)
- A small inaccuracy in the sample configuration file: less-watch-compiler.config.json HOT 1
- Can't use `rgba()` to modify a var HOT 4
- Node.js v14 Warning: Accessing non-existent property ___ of module exports inside circular dependency HOT 2
- Feature: Option "recursive" HOT 4
- Feature: --run-initially flag to compile once and then watch HOT 2
- .less extension in @import is not optional in watch mode under some file structures HOT 1
- less-watch-compiler.config.json not being loaded HOT 3
- --config switch no longer works HOT 2
- --run-once parameter is not working anymore HOT 2
- Dependency Dashboard
- Current version of less breaks media query aspect ratios HOT 8
- documentation on npm addition HOT 1
- Error if less file has space in name HOT 1
- Exlcude node_modules? HOT 1
- Unable to detect new directories
- Can't run "less-watch-compiler" command anymore HOT 2
- Feature: Option to include warning message in compiled CSS file
- less compilation with css-modules
- MaxListenersExceededWarning
- Remove unused dependency - opencollective ? HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deadsimple-less-watch-compiler.