Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legacy JS API does not handle symlinks properly #1687

Open
patricklx opened this issue May 4, 2022 · 8 comments
Open

Legacy JS API does not handle symlinks properly #1687

patricklx opened this issue May 4, 2022 · 8 comments

Comments

@patricklx
Copy link

patricklx commented May 4, 2022

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...

@jathak
Copy link
Member

jathak commented May 10, 2022

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

@jathak jathak closed this as completed May 10, 2022
@patricklx
Copy link
Author

patricklx commented May 11, 2022

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

@patricklx
Copy link
Author

Same code compiles with node-sass

@patricklx
Copy link
Author

@jathak

@jathak jathak reopened this May 16, 2022
@jathak
Copy link
Member

jathak commented May 16, 2022

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

@patricklx
Copy link
Author

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

@jathak
Copy link
Member

jathak commented May 23, 2022

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 jathak changed the title relative import fails (with two dots) on linux Legacy JS API does not handle symlinks properly May 23, 2022
@patricklx
Copy link
Author

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

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

No branches or pull requests

2 participants