Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
rails 5.1.0.rc1, sass-rails 5.0.6: variables declared in one file undefined in second file #474
From @stepheneb on April 3, 2017 17:13
In a very simple rails 5.0.1.rc1 application a sass variable defined in the file
This works correctly.
However if I remove the p styling from
Earlier I described this bug in a rails issue: rails/rails#28628 however I think the bug might be in the sass-rails gem.
Copied from original issue: rails/sass-rails#396
From @stepheneb on April 3, 2017 20:17
Example repo with simple Rails 5.1.rc1 app.
At this commit referencing the sass var from
At next commit referencing sass variable from second imported file doesn't work:
At last commit using sass-rails v5.0.6 instead of master branch version of gem (Rails 5.1.rc1 generated github reference for sass-rails gem in Gemfile) problem with second @import still present:
From @stepheneb on April 21, 2017 16:47
I was not able to reference sass variables in other files.
I have a much larger app running in Rails 5.0.2 where the referencing of sass variables works fine.
If it would be helpful I can add a branch to my simple sass-demo repo which uses Rails 5.0.2. I expect to see the referencing of sass variables in other files work (just like it does in my larger project) -- but with confusing bugs like this maybe it won't work ... and that will provide a useful clue.
From @stepheneb on April 21, 2017 18:19
Am getting a bit confused ... Here is the same set of commits in a new repo -- just using Rails 5.1.0.rc2. -- and the sass variable defined in
Now I need to find out why my earlier test with Rails 5.1.0.rc1 didn't work (at this point I'm not convinced it has to do with Rails 5.1.0.rc1).
From @stepheneb on April 21, 2017 19:59
The problem is with
At the time I created the original sass-demo repo with Rails 5.1.0.rc1
This seems strange because in the same
The demo built with Rails 5.1.0.rc2 instead resolves to
In the original sass-demo repository locking the Sprockets dependency in the Gemfile to 3.7.1 fixes the problem.
referenced this issue
Apr 21, 2017
referenced this issue
Jul 19, 2017
Not sure how much this helps, but a workaround that appears to work is to update the manifest to directly link the files you'd like pre-compiled:
Working example from the previously failing 'bad' branch example posted earlier:
My app was on Rails 4.2, Sprockets 2.12, and Sprockets-rails 2.3 and did not encounter this error. I started getting this error once I upgraded my app to Rails 5.1; Sprockets 3.7, and Sprockets-rails 3.2. I tried bumping Sprockets down to 3.3 but still seeing the error.