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

v3.4.14 not resolve relative @import from stdin #1745

Closed
Slach opened this issue Jun 14, 2015 · 8 comments
Closed

v3.4.14 not resolve relative @import from stdin #1745

Slach opened this issue Jun 14, 2015 · 8 comments
Labels
bug Something isn't working requires deprecation Blocked on a deprecation cycle

Comments

@Slach
Copy link

Slach commented Jun 14, 2015

I use sass in python under flask-assets (webassets)...
i have @import directive with relative import file in my theme.scss

i.e.
@import 'btn-o';

flask-assets over webassets run sass with following parameters

/usr/local/bin/sass --stdin --stylecompressed --line-comments --cache-location /app/src/spf/static/assets/.webassets-cache/sass--scss

when i'm using sass 3.4.13 evething work OK,

but when i'm use sass 3.4.14, i have error

Failed, error was: sass: subprocess had error: stderr=Error: File to import not found or unreadable: ./btn-o. on line 1 of standard input
  Use --trace for backtrace. , stdout=, returncode=65
@clausmith
Copy link

I can also confirm relative @import's are broken when piping into sass --stdin on version 3.4.14. Version 3.4.13 works fine.

@nex3
Copy link
Contributor

nex3 commented Jun 19, 2015

This is, more or less, intended. In 3.4, we stopped including the working directory on the load path by default because it didn't make sense that @import resolution was sensitive to where you ran the command from. There were a couple little places that still had remnants of that behavior, though, and those were rooted out in 3.4.14.

I didn't think there was going to be any executable behavior that would be affected by that change, but it looks like you found a place. If you think about it, the new behavior does make sense: the "file" with the @import is from STDIN, which has no location, so there's nothing for the @import to be relative to. If you want to be able to import from a particular directory, that directory should be passed in via -I.

That said, this is a breaking change, which we shouldn't make in a patch version. I'll update it to print a warning for now.

@nex3 nex3 added bug Something isn't working requires deprecation Blocked on a deprecation cycle labels Jun 19, 2015
nex3 added a commit that referenced this issue Jun 19, 2015
This ended up missing the previous deprecation, and was removed entirely
with 13afe93. Now it's deprecated, and will be removed (again) in the
next major release.

See #1745
@Slach Slach closed this as completed Jun 24, 2015
@nex3
Copy link
Contributor

nex3 commented Jun 25, 2015

I want to keep this open to track the eventual removal of support for it.

@nex3 nex3 reopened this Jun 25, 2015
@mscarchilli
Copy link

This problem is also happening in v 3.4.16. I reverted back to 3.4.13 where it didn't have this problem for me.

@nex3
Copy link
Contributor

nex3 commented Aug 21, 2015

@mscarchilli It looks like my fix only worked when --stdin was passed explicitly. I'll fix it to work with implicit stdin input as well.

A way better solution that reverting is to explicitly pass --load-path ., though. This is the only future-proof way to import from the working directory when loading Sass via standard input.

@mscarchilli
Copy link

@nex3 Ah ha! I added the loadPath to my grunt-contrib-sass task of '.' and that fixes that problem for me. Thank you.

nex3 added a commit that referenced this issue Aug 28, 2015
These were only working with an explicit --stdin, but they should work
for all stdin input.

See #1745
nex3 added a commit that referenced this issue Aug 28, 2015
These were only working with an explicit --stdin, but they should work
for all stdin input.

See #1745
@nex3
Copy link
Contributor

nex3 commented Apr 6, 2018

I'm moving this issue to the new Ruby Sass repository because it's specific to Ruby Sass's implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working requires deprecation Blocked on a deprecation cycle
4 participants