tomkr4l / font_awesome5_rails

font_awesome_5_rails is font awesome 5 gem bundled for rails asset pipeline
https://fontawesome.com/
MIT License
158 stars 25 forks source link

font_awesome5.css not loading in production environment #57

Closed olliebaum closed 4 years ago

olliebaum commented 4 years ago

We're getting the following error in our production environment: Failed to load resource: the server responded with a status of 404: font_awesome5.css It also shows in our production logs as ActionController::RoutingError (No route matches [GET] "/assets/font_awesome5.css"

Our icons are loading correctly, but for some reason we still get this error in the dev tools console. We think it may be increasing the load on our server so we need to get it fixed.

I can confirm we have the @import 'font_awesome5.css' line in our application.sass

When looking for font_awesome5.css on our production instance, it isn't there. However in staging and development environments, the file is correctly under assets and the above error is not encountered.

Have you any idea what may be causing our issue?

olliebaum commented 4 years ago

Ah, we figured out our issue. The problem was the .css extension on the import statement. So we needed @import 'font_awesome5'. Not sure why, but that appears to have fixed our issue - I was wondering if it's maybe something to do with us using an application.sass instead of the more standard application.css.scss. I'm not sure if this is something that could need updating in the readme here but I'l leave that to you. :)

tomkr4l commented 4 years ago

@olliebaum Hello, sorry for late response. I'm glad you've resolved your problem. I've updated README with link pointing to this issue for others people using .sass suffix.

However It's strange because according to sass documentation both imports with or without suffix should be valid. Anyway thanks for feedback, I'm closing this.