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

Error: File to import not found or unreadable #79

Closed
mttdffy opened this issue Jul 2, 2018 · 20 comments · Fixed by #81
Closed

Error: File to import not found or unreadable #79

mttdffy opened this issue Jul 2, 2018 · 20 comments · Fixed by #81

Comments

@mttdffy
Copy link

mttdffy commented Jul 2, 2018

As of 1.12.0 I am seeing errors like this:

ActionView::Template::Error: Error: File to import not found or unreadable: /opt/rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/normalize-rails-4.1.1/vendor/assets/stylesheets/normalize-rails/normalize.
        on line 1 of ../../../../../../opt/rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/normalize-rails-4.1.1/vendor/assets/stylesheets/normalize-rails.scss

Downgrading to 1.11.4 I no longer saw this issue.

@yjukaku
Copy link

yjukaku commented Jul 2, 2018

I can confirm the above as well in a brand new Rails project. Upgrading to 1.12.0 from 1.11.4 causes an issue. Will post a minimally reproducible setup in a second.

@tubbo
Copy link

tubbo commented Jul 2, 2018

the issue seems to be related to this: https://github.com/sass/libsass/releases/tag/3.5.3

@xzyfer ^

@yjukaku
Copy link

yjukaku commented Jul 2, 2018

rails generate new test-sassc
cd test-sassc
#... add sassc gem via gem 'sassc', '1.12.0'
bundle
// in app root dir, test.scss
@import "./other"
// other.css 
.something{
  color: red;
}

With gem 'sassc', '1.11.4'

bundle exec rails runner "puts SassC::Engine.new(\"@import 'test'\").render"
.something {
  color: red; }

With gem 'sassc', '1.12.0'

bundle exec rails runner "puts SassC::Engine.new(\"@import 'test'\").render"
/Users/test-sassc/test.scss:1: Error: File to import not found or unreadable: ./other. (SassC::SyntaxError)
        on line 1 of test.scss
        from line 1 of stdin
>> @import "./other"

   ^

@yjukaku
Copy link

yjukaku commented Jul 2, 2018

the issue seems to be related to this: https://github.com/sass/libsass/releases/tag/3.5.3

@tubbo I spent the majority of my morning looking through this and related issues, but what I can't understand is why that release would actually break anything. It seems that all that was added was a deprecation warning (which btw is pending to be rolled back, via sass/libsass#2684).

@xzyfer do you mind confirming that this release only added a deprecation warning. (also, thanks for all of your patience and work regarding this issue, I've seen how much effort you've put into these libraries!)

@xzyfer
Copy link

xzyfer commented Jul 3, 2018

Please file an issue with the gem repo https://github.com/sass/sassc-rails

@deivid-rodriguez
Copy link
Contributor

@xzyfer I don't think sassc-rails is related. That gem has not seen changes for a long time whereas this gem made a release yesterday. The breaking change seems to be caused indeed by the upgrade in the libsass vendored by this gem.

@yjukaku
Copy link

yjukaku commented Jul 3, 2018

sassc-rails is definitely not related. Here's an updated example that doesn't use Rails at all, just bundler and sassc.

Setup

mkdir sassc-imports
cd sassc-imports
bundle init
echo "ruby '2.4.3'" >> Gemfile
echo "2.4.3" >> .ruby-version
echo "gem 'sassc', '1.11.4'" >> Gemfile
bundle
echo ".something{color: red}" > test.css

With SassC 1.11.4

bundle exec ruby -e "require 'sassc'; puts SassC::Engine.new(\"@import 'test'\").render"
.something {
  color: red; }

With SassC 1.12.0

bundle exec ruby -e "require 'sassc'; puts SassC::Engine.new(\"@import 'test'\").render"
stdin:1: Error: File to import not found or unreadable: test. (SassC::SyntaxError)
        on line 1 of stdin
>> @import 'test'
   ^
	from /Users/whatever/.rbenv/versions/2.4.3/lib/ruby/gems/2.4.0/gems/sassc-1.12.0/lib/sassc/engine.rb:47:in `render'

@tubbo
Copy link

tubbo commented Jul 3, 2018

@xzyfer This is the proper repo for this issue, as it's an issue with the version of libsass that sassc-ruby has vendored in.

The submodule for libsass in this repo points to https://github.com/sass/libsass/commits/1e52b74306b7d73a617396c912ca436dc55fd4d8

But, that commit is before the fix that would have prevented all of these issues. So we really need libsass to be at https://github.com/sass/libsass/tree/19fd2bf2e31413b5935e7feb87fec630b486feba.

@bolandrm
Copy link
Member

bolandrm commented Jul 3, 2018

@tubbo i'd prefer not to point at an arbitrary commit, but rather a release... Is there a release that resolves this? I don't have much time to dig into this at the moment.

@deivid-rodriguez
Copy link
Contributor

deivid-rodriguez commented Jul 3, 2018

It seems to me that libsass intends to release a new version in the 3.5 series fixing this, so it should be enough to update the vendored version of libsass once that happens and release 1.12.1 after that.

@bolandrm
Copy link
Member

bolandrm commented Jul 3, 2018

Cool, when that is done I'll update to it.

@bolandrm
Copy link
Member

bolandrm commented Jul 3, 2018

If anyone is interested in contributing to the project, it would be nice to have a failing test for this.

tubbo pushed a commit to tubbo/sassc-ruby that referenced this issue Jul 3, 2018
This resolves sass#79 and fixes an issue where the latest SassC is unable to
`@import` files that end in a `.css` extension. By pulling in the latest
changes of libsass at branch '3-5-stable', the breaking change that
caused this issue will be reverted and life goes back to normal.
@yjukaku
Copy link

yjukaku commented Jul 3, 2018

@bolandrm Unfortunately I don't think that's really an option. This is a "bug" in libsass, not in this library. And I say "bug", because it's actually something that will be unsupported in the future, but was temporarily rolled back for now. (AFAICT)

@tubbo
Copy link

tubbo commented Jul 3, 2018

Not yet @bolandrm, these commits are at the top of the 3-5-stable branch, and I suppose they'll eventually be released into v3.5.5 of libsass, but as of now I just took the top of the stable branch to see if that would fix the problem (which it did). I'm also in agreement with you that it would be better to lock it down to a release, not just an arbitrary commit, we just need a release of libsass in order to proceed.

@bolandrm
Copy link
Member

bolandrm commented Jul 3, 2018

@yjukaku sorry, i'm not exactly following what you are saying. What is your proposed resolution?

@yjukaku
Copy link

yjukaku commented Jul 3, 2018

Sorry for being unclear. I meant, I don't think it makes much sense to write a failing test for this issue in this repo, since it's really just because of a problem in libsass.

I do agree that it would be better to wait until a new release of libsass rather than an arbitrary commit to release a new version of sassc.

@deivid-rodriguez
Copy link
Contributor

Well, had the regression test been present in this repo, the 1.12.0 release wouldn't have included this regression. So, no matter where the root problem lies, a regression test seems useful.

@deivid-rodriguez
Copy link
Contributor

I opened #81 including a regression test, by the way!

@jmarkbrooks
Copy link

Any idea when this will be fixed? or should users just revert to 1.11.4 for now?

@bolandrm
Copy link
Member

bolandrm commented Jul 5, 2018

Just released 1.12.1, please give it a try. Thanks all!

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