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

deprecation warnings with sprockets 3.7.0 #381

Closed
maia opened this issue Jul 21, 2016 · 16 comments
Closed

deprecation warnings with sprockets 3.7.0 #381

maia opened this issue Jul 21, 2016 · 16 comments

Comments

@maia
Copy link

maia commented Jul 21, 2016

sass-rails-5.0.5 throws deprecation warnings when using sprockets 3.7.0:

DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
(called from block (2 levels) in <class:Railtie> at /…/gems/sass-rails-5.0.5/lib/sass/rails/railtie.rb:57)
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
(called from block (2 levels) in <class:Railtie> at /…/gems/sass-rails-5.0.5/lib/sass/rails/railtie.rb:58)
@rob-race
Copy link

Quick fix for me(for now) was...

gem 'sprockets', '3.6.3'

@jaredbeck
Copy link

Same warning in js-routes (railsware/js-routes#201) I suspect a lot of sprockets extensions will be fixing this in similar ways and may benefit from each other's work.

@kapso
Copy link

kapso commented Jul 21, 2016

Seeing same warning in https://github.com/ai/autoprefixer-rails

@rafaelfranca
Copy link
Member

cc @schneems

@schneems
Copy link
Member

Working on a PR.

schneems added a commit that referenced this issue Jul 21, 2016
- Use both `register_engine` and `register_transformer` in railtie.rb. 
- In the test postprocessor use an object that responds to `call` and `new.render`.
schneems added a commit that referenced this issue Jul 22, 2016
- Use both `register_engine` and `register_transformer` in railtie.rb. 
- In the test postprocessor use an object that responds to `call` and `new.render`.
schneems added a commit that referenced this issue Jul 22, 2016
- Use both `register_engine` and `register_transformer` in railtie.rb. 
- In the test postprocessor use an object that responds to `call` and `new.render`.
schneems added a commit that referenced this issue Jul 22, 2016
@maia
Copy link
Author

maia commented Jul 23, 2016

@schneems Thanks a lot for solving the issue with the release of 5.0.6!

@schneems
Copy link
Member

Thanks all for chiming in. I added some docs to Sprockets guides on master to show how to register an processor across Sprockets 2, 3, and 4. Link: https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#registering-all-versions-of-sprockets-in-processors

I also re-wrote the guide to be easier to reference, put the most relevant examples at the top of the sections and added a table of contents at the top. Please take a look and if you have something to add or ways you think the docs could be better open an issue and we can talk about it. I want the process of maintaining Sprockets extensions to be as easy as possible, I'm hoping the docs can smooth out rough edges and cut down on guessing how to write a sprockets plugin.

If you're working on getting rid of deprecations in your own library and having problems, ping me on a pull request.

@calderJamNet
Copy link

hey @schneems , I just updated my gem library for the first time in a while and a bunch of css/scss (but not everything) is not loading correctly, and I'm also seeing this error. Is it likely that this is related? I've never really used sprockets before so its not really clear to me why this would be happening.

@schneems
Copy link
Member

schneems commented Aug 1, 2016

@calderJamNet if you have a repro example app please put it on github and give me access. If not you can manually specify an older version of sprockets and sass-rails in your Gemfile.lock.

Do you have any more details other than not working correctly?

@calderJamNet
Copy link

Hey @schneems, I added you to the repo. Its just a testing ground for front end styles so its kind of a mess. I did however notice the same changes when I updated all the gems in the main repo.

The differences I have noticed so far have only affected "border" and "color" css styles, with the original foundation styles being applied now while before they were being overwritten. They are minor and could be fixed easily with "!important" but I would like to understand why this started happening if possible.

This is how it was before bundle update:
screen shot 2016-08-02 at 10 49 38 pm

This is how it is after:
screen shot 2016-08-02 at 10 49 27 pm

so far I've only noticed it affecting styles for founations ".accordion", so perhaps the issue is routed in something they changed, in which case I apologize for wasting your time.

@schneems
Copy link
Member

@calderJamNet i'm back from vacation and will probably have time to look at this sometime this week. I made an issue for a reminder since this issue is "closed" #384

@veborich
Copy link

Thanks all for chiming in. I added some docs to Sprockets guides on master to show how to register an processor across Sprockets 2, 3, and 4. Link: https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#registering-all-versions-of-sprockets-in-processors

@schneems I haven't customized Sprockets before -- what's the typical file/location that you would place the env conditional code you provide in that link above?

@schneems
Copy link
Member

I haven't customized Sprockets before

This deprecation should only come from gems that are customizing sprockets for you, what is the deprecation output say? It should point it at a location, probably from a gem.

@calderJamNet
Copy link

@schneems I haven't customized sprockets before this either. How do I view the deprecation output?

@schneems
Copy link
Member

@calderJamNet i don't understand the question. If you're using Sprockets 3.7 and using another gem that doesn't support Sprockets 4 yet, then you'll see deprecation output in your output when you build assets or run in development.

@scarekr0w
Copy link

  1. Add the sass rails gem to the the GemFile
    a) gem 'sass-rails', '~> 5.0', '>= 5.0.6'

  2. Run gem install sass-rails on the terminal
    a) gem install sass-rails

  3. Run bundle install
    a) bundle install --without production && bundle update

ispyropoulos pushed a commit to testributor/katana that referenced this issue Sep 7, 2016
dgmstuart added a commit to dgmstuart/swingoutlondon2 that referenced this issue Sep 9, 2016
sass-rails had an issue, so needed to be greater than 5.0.6
rails/sass-rails#381
dsteelma-umd added a commit to dsteelma-umd/archelon that referenced this issue Aug 16, 2017
Update "sass-rails" gem from v5.0.5 to v5.0.6 to fix the following
deprecation warnings appearing at startup and running tests:

```
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
 (called from block (2 levels) in <class:Railtie> at /Users/dsteelma/.rvm/gems/ruby-2.2.4@archelon/gems/sass-rails-5.0.5/lib/sass/rails/railtie.rb:57)
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
 (called from block (2 levels) in <class:Railtie> at /Users/dsteelma/.rvm/gems/ruby-2.2.4@archelon/gems/sass-rails-5.0.5/lib/sass/rails/railtie.rb:58)
```

See rails/sass-rails#381

https://issues.umd.edu/browse/LIBHYDRA-105
dsteelma-umd added a commit to dsteelma-umd/archelon that referenced this issue Aug 16, 2017
Update "sass-rails" gem from v5.0.5 to v5.0.6 to fix the following
deprecation warnings appearing at startup and running tests:

```
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
 (called from block (2 levels) in <class:Railtie> at /Users/dsteelma/.rvm/gems/ruby-2.2.4@archelon/gems/sass-rails-5.0.5/lib/sass/rails/railtie.rb:57)
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
 (called from block (2 levels) in <class:Railtie> at /Users/dsteelma/.rvm/gems/ruby-2.2.4@archelon/gems/sass-rails-5.0.5/lib/sass/rails/railtie.rb:58)
```

See rails/sass-rails#381

https://issues.umd.edu/browse/LIBHYDRA-105
dsteelma-umd added a commit to dsteelma-umd/archelon that referenced this issue Aug 16, 2017
Update "sass-rails" gem from v5.0.5 to v5.0.6 to fix the following
deprecation warnings appearing at startup and running tests:

```
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
 (called from block (2 levels) in <class:Railtie> at /Users/dsteelma/.rvm/gems/ruby-2.2.4@archelon/gems/sass-rails-5.0.5/lib/sass/rails/railtie.rb:57)
DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
 (called from block (2 levels) in <class:Railtie> at /Users/dsteelma/.rvm/gems/ruby-2.2.4@archelon/gems/sass-rails-5.0.5/lib/sass/rails/railtie.rb:58)
```

See rails/sass-rails#381

https://issues.umd.edu/browse/LIBHYDRA-105
havenwood added a commit to havenwood/connect-api-examples that referenced this issue Dec 7, 2017
The Rails update from 4.2.6 to 4.2.7 caused Sprockets-related
deprecation warnings:

  DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.

These were fixed in sass-rails: rails/sass-rails#381
raysapida added a commit to raysapida/treebook that referenced this issue Aug 11, 2018
- Had to update gems individually as bundle update informed me of
dependencies that they could not match.
- The gem sass-rails was throwing a deprecation for a sprocket method
called `register_enginerj` and had to be updated. Reference:
rails/sass-rails#381
- Specs were throwing an error `undefined method `cache' for nil:NilClass`
and researching solved it by updating rspec-rails
- Kept changing gem versions until I found that all specs were passing
again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants