sass-rails-source-maps icon indicating copy to clipboard operation
sass-rails-source-maps copied to clipboard

Seems to be broken with latest version of Sprockets

Open virtualfunction opened this issue 10 years ago • 9 comments

I get an error about not being able to find / load Sprockets::SassImporter after a recent bundle update

The offending piece of code is: https://github.com/vhyza/sass-rails-source-maps/blob/master/lib/sass-rails-source-maps/sass_importer.rb#L2

virtualfunction avatar Apr 22 '15 07:04 virtualfunction

I get the same, did you figure out a way to solve this yet?

janv avatar May 12 '15 10:05 janv

Ditto. Any solution?

mischacolley avatar May 13 '15 02:05 mischacolley

The Sprokets gem has renamed the class

I've hacked round this for now by placing in my applicaiton.rb

require 'sprockets'
Sprockets::SassImporter = Sprockets::SassProcessor

just above the Bundler.require *Rails.groups line

virtualfunction avatar May 22 '15 13:05 virtualfunction

Oh wait, I'm getting errors elsewhere. I get the impression this gem is out of date in respect to version 3.x of sprockets. If you look at https://github.com/sstephenson/sprockets/issues/643 you'll see version 4.x will support source maps via config.sass.sourcemaps = :file in config/environments/*.rb. I think it's a case of the sprockets-rails gem needs to catch up to support this.

virtualfunction avatar May 22 '15 16:05 virtualfunction

Hi, I'm getting the same errors, I had to disable the gem when updating to the last Rails version. Before it wasn't working either but it wasn't giving me any errors at all.

7vs avatar Jun 22 '15 08:06 7vs

yeah this thing is totally busted with sprockets 3.0 and up. any word on development?

jmondo avatar Jul 09 '15 22:07 jmondo

I have a rather sloppy & hastily adapted fork at https://github.com/inopinatus/sass-rails-source-maps. It is of "it works for me" quality and would need tidying up before submitting a pull request.

Nonetheless there it is, if that helps any of you out until sprockets 4.x comes along.

Tested solely with: sprockets 3.2.0, sprockets-rails 2.3.2, sass-rails 5.0.3, sass 3.4.15.

inopinatus avatar Aug 24 '15 08:08 inopinatus

Another option is https://github.com/sass/sassc-rails Faster and supports:

# config/environments/development.rb
config.sass.inline_source_maps = true

franciscolourenco avatar Nov 12 '16 20:11 franciscolourenco

thanks @aristidesfl for the tip. This gem is abandoned for quite some time now, so it is nice there is more reliable alternative. I add the note to the README..

vhyza avatar Nov 25 '16 14:11 vhyza