intellij-lessc-plugin icon indicating copy to clipboard operation
intellij-lessc-plugin copied to clipboard

Compile Error: can't find @import file, but file exists

Open holloway87 opened this issue 11 years ago • 8 comments

I want to compile a less file with many import statements. The compiler gives an error message on the first imported file that it doesn't exist, but the file is definitely there and the editor has access to it. I can even open the file using the Go to Declaration function.

This is the complete error message: LESS CSS Compiler Error: bootstrap.less: org.mozilla.javascript.UniqueTag@1ba3e4a: NOT_FOUND Error: java.io.IOException: No such file file:/C:/XXX/Resources/less/variables.less (line -1, column -1)

With PhpStorm 7 everything worked fine, but now with PhpStorm 7.1 it suddenly stopped working.

The settings for the LESS profile are: LESS source Directory: C:/XXX/Resources/less Included files by path: bootstrap.less CSS Output Directory: C:/XXX/Resources/public/css

The content of bootstrap.less:

// Core variables and mixins
@import "variables.less";
@import "../../../../../vendor/twitter/bootstrap/less/mixins.less";
// and so on ...

I have reinstalled the plugin, removed the config directory for lessc, but i can't get it to work.

holloway87 avatar Jan 10 '14 13:01 holloway87

I have the same error. The problem is a space in the file path ( in my case ): /C:/../Project%20Files/../default.less.

nSamu avatar Jan 16 '14 22:01 nSamu

I just updated and now having an error too. NOT_FOUND Error: java.io.IOException: No such file file:/C:/Users/me/My%20Project/less/functions.less (line -1, column -1)

bluemoehre avatar Jan 27 '14 11:01 bluemoehre

I've ran into this problem just now and it seems to be a path related issue. Removing all whitespace from my project path solved the problem. More of a workaround instead of a fix but it'll do for now.

JasonSuave avatar Apr 16 '14 06:04 JasonSuave

Hi there, me too, same issue with space in folder:

LESS CSS Compiler Error: wpdk-table.less: org.mozilla.javascript.UniqueTag@33ada31e: NOT_FOUND Error: java.io.IOException: No such file file:/Users/giovambattistafazioli/Lavori/Giovambattista%20Fazioli/GIT%20e%20Subversion/GitHub%20wpXtreme/wpdk/assets/less/assets/less/wpdk-variables.less (line -1, column -1)

It's very hard rename all foldesr from Git & Subversion to Git-&-Subversion, I'll lost all my links...

Is there some simple workaround ?

gfazioli avatar Feb 21 '15 15:02 gfazioli

Hi there, anyone know how i could to fix this issue?

elartix avatar Mar 10 '15 16:03 elartix

Haven't tried this out yet but you could try creating a symlink or alias to the directory that has the spaces in them.

JasonSuave avatar Mar 11 '15 07:03 JasonSuave

Yes, I have tried! But doesn't work :(

gfazioli avatar Mar 11 '15 08:03 gfazioli

Yeah, got the same issue…  Guess I'll move my project into a folder with no spaces... weaksauce

To @acdvorak, my guess is the problem is some of the url-escape stuff in /lessc-plugin/src/net/andydvorak/intellij/lessc/fs/LessFile.java

amatecha avatar Oct 12 '15 07:10 amatecha