Closed gomedia-adi closed 3 years ago
@import "less";
If your ImportNode's path is not endwith less(color.less
) or relative file path(../bootstrap
), it means you want import a npm
less lib. In current case, you want import less
npm package, but you know less
is a css preprocessor and not a less
lib which supoort a style
port (in package.json
). So you will encount a ParseError !
Because the less
's file-manager
lookup read file logic !
less.js/packages/less/src/less-node/file-manager.js
When less
try to lookup file, it will try to read file which path is:
less
self, it exist but not a valid less file nor less npm library.So you will get a ParseError
rather than FileError
.
It's expected behavior, I think we don't need change anything. /cc @matthew-dean
I'm using the CodeKit app on MacOS, which in turn is using LESS v4.1.1
The following code:
@import 'less';
fails, when the file less.less doesn't exist, with:
Compiling failed with this error: ParseError: Unrecognised input in /Applications/CodeKit.app/Contents/Resources/engines/node_modules/less/index.js on line 1, column 16: 1 module.exports = require('./lib/less-node').default; 2
However, this code:
@import 'less.less';
fails (when the file less.less doesn't exist) with:
Compiling failed with this error: FileError: 'less.less' wasn't found. Tried - ...blah blah... on line 1, column 1: 1 @import 'less.less'; 2
The developer of CodeKit assures me that these errors are coming from the LESS compiler.
The first error message is not very helpful. The second is. Not a big deal in the grand scheme of things but I thought I'd mention it anyway!