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

List manifest locations when asset is not found #468

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Sep 25, 2020

  1. List manifest locations when asset is not found

    When using an asset manifest file `config.assets.compile = false` the developer might not know that a `assets:precompile` manifest file is being used, or they might not know which file (if there are multiple). To help debug this situation we can detect which asset resolution strategies contain a "file" and output the location of that file:
    
    ```
    The asset "does_not_exist.js" is not present in the asset pipeline.
    Checked in manifest file: /Users/rschneeman/Documents/projects/sprockets-rails/tmp/app/public/assets/.sprockets-manifest-7bdd432004acd447a520e289399bcf62.json
    ```
    
    I lost about 30 minutes debugging an error I was seeing locally while running with RAILS_ENV=production. It was telling me a file "was not present in the asset pipeline" which I took to mean it wasn't in `app/assets` or maybe the config declaration was wrong. Everything looked right, it wasn't until much later I realized that I had somehow gotten an old manifest file generated from an older `assets:precompile`run so it was checking that file to see if the asset was "present in the pipeline". 
    
    By adding the location of the manifest file to the output, it's more likely that I would have realized that sprockets was only checking that file and that the solution was to re-generate it.
    schneems committed Sep 25, 2020
    Configuration menu
    Copy the full SHA
    fa8b07c View commit details
    Browse the repository at this point in the history