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

Not working with rails 8, css bundling and esbuild. #240

Open
carolyn-idi opened this issue Jan 7, 2025 · 1 comment
Open

Not working with rails 8, css bundling and esbuild. #240

carolyn-idi opened this issue Jan 7, 2025 · 1 comment

Comments

@carolyn-idi
Copy link

I'm using Rails 8 with CSS bundling and esbuild.

Per the fontawesome documentation I added the gem to the Gemfile, ran bundle install and added @import "fontawesome-free"; to my applicaiton.boostrap.scss.

When I start the app I get the following error:
11:54:49 css.1 | Error: Can't find stylesheet to import.
11:54:49 css.1 | ╷
11:54:49 css.1 | 11 │ @import "font-awesome";

I also removed the gem and installed the free version with yarn and added the appropriate @import command to application.js - which did load the icons, but the build files with: Error: https://npm.fontawesome.com/@fortawesome/fontawesome-free/-/6.7.2/fontawesome-free-6.7.2.tgz: Request failed "401 Unauthorized"
when trying to deploy to Heroku.

I've used fontawesome for years without issue. Any ideas on how this can be fixed?

@fredbanda
Copy link

fredbanda commented Feb 6, 2025

I find using cdn to be a best option. Just add fontawesome cdn link to your application.html.erb thats the best option especially if you are using free option

"" added to the file just after the meta tags

or you can follow this guy's steps "https://pablofernandez.tech/2022/03/12/using-font-awesome-6-in-a-rails-7-project-that-uses-importmaps/" it does work

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

2 participants