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

Sprockets 4.2.0: Generates 404 on all assets #605

Open
james-em opened this issue Mar 3, 2023 · 2 comments
Open

Sprockets 4.2.0: Generates 404 on all assets #605

james-em opened this issue Mar 3, 2023 · 2 comments

Comments

@james-em
Copy link

james-em commented Mar 3, 2023

Hi,

All my gems are up to date. My frontend packages on the other hand very outdated, however it doesn't matter in the matter of this issue.

The CLI command

bundle exec rake ember:compile

builds by default assets into tmp/ember-cli/apps/frontend/assets and there is some magic that makes

GET http://localhost:3000/assets/vendor.css

possible.

However, starting with Sprockets 4.2.0, these GET http://localhost:3000/assets/vendor.css makes 404.

Just though I would share in case somebody else hits the same bug.

@factor4
Copy link

factor4 commented May 17, 2023

Hi! I solved this by not loading sprockets at all. In config/application.rb only load what you need and comment sprockets out:

require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "active_storage/engine"
require "action_controller/railtie"
require "action_mailer/railtie"
# require "action_mailbox/engine"
# require "action_text/engine"
require "action_view/railtie"
# require "action_cable/engine"
# require "sprockets/railtie"
require "rails/test_unit/railtie"

You also have to comment out various config options which belongs to the assets pipeline under config/environments/* and config/initializers/assets.rb.

@xtagon
Copy link

xtagon commented Oct 16, 2023

Fixed in Sprockets 4.2.1

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

3 participants