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

Conversation

schneems
Copy link
Member

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:precompilerun 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.

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
Copy link
Member Author

schneems commented Sep 25, 2020

Speaking in the Meta about the sprockets-rails project: These tests are not good. We need to move off of travis. Kill support for older rubies. Kill support for older Rails versions (sorry, if Rails core doesn't support it anymore, I don't want to support it either).

Ideally, I would LOVE to kill this gem too and put it directly in sprockets, but I don't know if it's worth it. I believe it's not there because Josh didn't want to be coupled to Rails at all. But as a result, this gem is much more complicated as it has to support a matrix of Rails and Sprocket versions.

@skatkov
Copy link
Contributor

skatkov commented Sep 26, 2020

@schneems you want to migrate off travis, what exactly do you want to migrate to? Github actions?

@schneems
Copy link
Member Author

schneems commented Oct 6, 2020

I'm not super happy with GitHub due to their involvement with ICE so I try to not use actions if I can avoid it. I have the most experience with CircleCI. It looks like Rails switched over to build kite. I'm asking in the basecamp chat to see if there's a policy of sorts.

@skatkov
Copy link
Contributor

skatkov commented Oct 8, 2020

Will be happy to give you hand with this as well, once you'll arrive at final decision.

Like you, I have way more experience with CircleCI, but buildkite is doable too.

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

Successfully merging this pull request may close these issues.

None yet

2 participants