dotless.Compilter --watch breaks w/@imports that have relative paths. #17

Closed
stevenharman opened this Issue Feb 12, 2011 · 2 comments

Comments

Projects
None yet
2 participants

with the following folder structure:
-/
-/main.less
-/_some-mixin.less
-/theme/my-theme.less

Both main.less and the my-theme.less @import the _some-mixin.less file via @import "_some-mixin" and @import "../some-import", respectively.

If I dotless.Compiler ./main.less --watch everything works great. It finds the _some-mixin.less file and also watches it, recompiling main.less when I change either main or _some-mixin.

Now do dotless.Compiler ./theme/my-theme.less --watch and it again finds the files and starts watching them. Changing the my-theme.less works and it gets re-compiled. However, changing the _some-mixin.less file fails with:

Unhandled Exception: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
at System.ThrowHelper.ThrowKeyNotFoundException()
at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
at dotless.Compiler.Watcher.FileChangedHandler(Object sender, FileSystemEventArgs e)
at System.IO.FileSystemWatcher.OnChanged(FileSystemEventArgs e)
at System.IO.FileSystemWatcher.NotifyFileSystemEventArgs(Int32 action, String name)
at System.IO.FileSystemWatcher.CompletionStatusChanged(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* overlappedPointer)
at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)
Signal 79

Are relative imports allowed? I would assume so because compiling the my-theme.less file directly works, its just --watch that barfs.

Owner

Tigraine commented Feb 12, 2011

I could reproduce this on my machine and am looking into it..

Owner

Tigraine commented Feb 12, 2011

Fixed it in 5208ce6
The problem was that the LessEngine returns foward slashes as imports because that's how the handler presents stuff to the web.
The Console Compiler does require backward slashes though.
I fixed this with a Decorator on the LessEngine so I don't screw up the handler implementation.

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment