substancelab/route_downcaser

The update to 1.1.0 broke my asset pipeline

waissbluth opened this issue · 18 comments

When updating from 1.0.1 to 1.1.0 my assets stope being served. Even if they are not uppercase.

This yields 404: GET http://localhost:3000/assets/jquery.js?body=1

I'm running into the same problem, without the gems all assets are served fine.

--- Updated ---
What my Chrome console says:

localhost/:14 Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:3000/admin/login".
2015-05-02 11:20:04.142 (index):1 Refused to execute script from 'http://localhost:3000/assets/jquery.self.js?body=1' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
2015-05-02 11:20:04.143 (index):14 Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:3000/admin/login".
2015-05-02 11:20:04.143 (index):15 Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:3000/admin/login".
2015-05-02 11:20:04.143 (index):1 Refused to execute script from 'http://localhost:3000/assets/jquery.turbolinks.self.js?body=1' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
2015-05-02 11:20:04.466 (index):16 Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:3000/admin/login".
2015-05-02 11:20:04.466 (index):1 Refused to execute script from 'http://localhost:3000/assets/jquery_ujs.self.js?body=1' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
2015-05-02 11:20:04.466 (index):1 Refused to execute script from 'http://localhost:3000/assets/turbolinks.self.js?body=1' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
2015-05-02 11:20:04.466 (index):1 Refused to execute script from 'http://localhost:3000/assets/application.self.js?body=1' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
2015-05-02 11:20:04.467 (index):17 Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:3000/admin/login".
2015-05-02 11:20:04.467 (index):18 Resource interpreted as Script but transferred with MIME type text/html: "http://localhost:3000/admin/login".
2015-05-02 11:20:04.633 (index):101 Resource interpreted as Image but transferred with MIME type text/html: "http://localhost:3000/admin/login".
2015-05-02 11:20:04.734 (index):125 Resource interpreted as Image but transferred with MIME type text/html: "http://localhost:3000/admin/login".

All requests seems to be redirected to my /admin/login route (which is an route from ActiveAdmin)

Hey guys, thanks for telling me. I'm a bit busy this weekend, but I'll look into it monday or tuesday.

BTW: Rails version + Ruby version please :-) Makes it much easier to debug

You're absolutely right, Ruby version: 2.2.0, Rails: 4.2.1. Thanks for looking into it 👍

Just tested it against ruby version 2.2.1 (same Rails version), but problem exists.

Same here.

On Sat, May 2, 2015 at 8:37 AM, Loed Idzinga notifications@github.com
wrote:

Just tested it against ruby version 2.2.1 (same Rails version), but
problem exists.


Reply to this email directly or view it on GitHub
#17 (comment)
.

Nicolás Waissbluth Razmilic

Any updates on this? :)

Hey guys, sorry for the delay. I've just released v. 1.1.1, that should fix the issue. I made my own instead of just pulling TikiTDO's PR, since it did not contain test-cases. But I've referenced him in the changelog :) Let me know if this solves your issues

Thanks for the new release, but it doesn't fix the issues just yet. Get the same errors appear as in other comment.

Okay I'll have another look.

Okay I managed to create a test-case inside the gem's test-suite that matches the 404 issue you describe. This should hopefully make it easier for me to figure out the problem then. I'll be back as soon as the problem is solved.

@loed-idzinga Would you mind posting your Gemfile?

@carstengehling Of course!

source 'https://rubygems.org'

gem 'rails', '4.2.1'
gem 'pg'

gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'therubyracer', platforms: :ruby
gem 'jquery-rails'
gem 'turbolinks'
gem 'jquery-turbolinks'
gem 'normalize-rails'
gem 'bourbon'
gem 'neat'
gem 'slim-rails'
# # gem 'ckeditor_rails'

# Routes modifier
# gem 'route_downcaser'

# # Deployment
gem 'capistrano'
gem 'capistrano-rails'
gem 'capistrano-rbenv'
gem 'rollbar'

# CMS
gem 'activeadmin', github: 'activeadmin'
gem 'inherited_resources'
gem 'devise'
gem 'acts_as_list'
gem 'activeadmin-sortable'

# Row position
gem 'ranked-model'

group :development do
  gem 'quiet_assets'
  gem 'rails_best_practices'
  gem 'mailcatcher'
  gem 'bullet' # Performance checks
end

# Image processing
gem 'paperclip'

# Database backups
gem 'dumper'

I would gladly help you, so let me know if you need anything 👍 .

I disabled the gem for developing purposes, otherwise I can't continue.

Thank you. Could you try to add route_downcaser like this instead:

gem 'route_downcaser', git: 'https://github.com/carstengehling/route_downcaser.git'

and run

bundle install

I've made some changes, and this is the easiest way to test it without me making new version releases while we test it.

This update works like a charm! What was causing this issue?

Well since your comment earlier today I have not changed any code - only tests. So i suspect that you might have missed doing a bundle update to get the latest version, and so were still really testing on version 1.1.0.

Anyway, it's great that it works for you again. I am just fixing one minor issue about not redirecting POST requests. When this is done, I'll release a new version 1.1.2.

That's wierd, when I tested the new version I put gem 'route_downcaser', '1.1.1' in the Gemfile and ran a bundle. I must have overlooked something.

Anyway, I'm very glad that the gem is working. Thank you for your effort you put in this gem!

1.1.2 just published - please try it out.

And you are very welcome. Apparently a lot of people out there are using this gem, that came to my mind a couple of years ago. That is quite humbling, and makes me want to keep it top-quality. :-)