dart-sass icon indicating copy to clipboard operation
dart-sass copied to clipboard

Legacy JS API does not handle symlinks properly

Open patricklx opened this issue 3 years ago • 8 comments

this is with npm sass .

relative import fails when it starts with 2 dots @import ../some-style.

I also checked how fs.existsSync handles paths with .. in it. on linux fs.existsSync fails to find the file if the path contains .., on windows it works...

patricklx avatar May 04 '22 12:05 patricklx

Import URLs need to be in quotes, e.g. @import "../some-style"

jathak avatar May 10 '22 20:05 jathak

It is with quotes in the app. Sorry i forgot to put them here in the example. The issue still persists.

patricklx avatar May 11 '22 08:05 patricklx

Same code compiles with node-sass

patricklx avatar May 11 '22 08:05 patricklx

@jathak

patricklx avatar May 11 '22 19:05 patricklx

Can you provide a reproduction? ../ works in any case I can find.

jathak avatar May 16 '22 20:05 jathak

hi @jathak , I worked on the reproduction and figured out that its happending when using symbolic links. https://github.com/patricklx/test-sass

patricklx avatar May 17 '22 08:05 patricklx

It looks like this is an issue with the legacy JS API not handling symlinks properly. It works fine both when using the command line, and when using the new JS API, so for your case I'd recommend migrating to the new API to workaround this.

jathak avatar May 23 '22 20:05 jathak

okay... But i do not control the api call, since that is done in another npm package

patricklx avatar May 23 '22 20:05 patricklx