-
Notifications
You must be signed in to change notification settings - Fork 792
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
Add more context to Sprockets::FileNotFound error messages #252
Comments
5minpause
pushed a commit
to 5minpause/sprockets
that referenced
this issue
Jun 16, 2016
When `resolve!` raises an error, it would not display the paths that were used to look up the assets. If we raise this error we can be even more helpful and display the `config[:path]` as well. This makes it easier for users to debug their asset paths. References rails#252
5minpause
pushed a commit
to 5minpause/sprockets
that referenced
this issue
Jun 16, 2016
When `resolve!` raises an error, it would not display the paths that were used to look up the assets. If we raise this error we can be even more helpful and display the `config[:path]` as well. This makes it easier for users to debug their asset paths. References rails#252
Hi @schneems I created a pull request, that displays the load paths together with the regular error message. Perhaps this is helpful? Any feedback is appreciated. |
schneems
pushed a commit
that referenced
this issue
Jul 21, 2016
When `resolve!` raises an error, it would not display the paths that were used to look up the assets. If we raise this error we can be even more helpful and display the `config[:path]` as well. This makes it easier for users to debug their asset paths. References #252
Ugh, I only merged that behavior into 3.x and not into master. There is a branch I need to get green on tests first #322. |
This was fixed in #322 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sort of related to #251. If the error messages I had gotten had included more information, perhaps it wouldn't matter that the documentation hadn't helped me.
This is with a brand new rails 4.2.5.1 app and sprockets 3.5.2.
The relevant part of that issue to this issue is that I had a file in
app/assets/other_javascripts/f.js
(a sibling directory toapp/assets/javascripts
, not a subdirectory) and I tried to require it inapp/assets/javascripts/application.js
by addingrequire ../other_javascripts/f
. () When I runrake assets:precompile
in this state, I get this error message:Now, I know app/assets/javascripts isn't the only place sprockets is looking, since the comment at the top of application.js says I can also put js in lib/assets/javascripts and vendor/assets/javascripts and reference them directly here.
I also happen to know that if I instead use
require f
, sprockets DOES findapp/assets/other_javascripts/f.js
(https://github.com/carols10cents/sprockets-test-app/commit/cb1315e645e5f2118776caf62b6667f7cbe323b5), so it's clearly looking more places.It'd be great if the error message for
Sprockets::FileNotFound
showed me all the paths sprockets was looking for assets, and showed me how it was resolving the paths, so that I could understand and correct the path I'm putting into application.js.The text was updated successfully, but these errors were encountered: