{"action":"opened","issue":{"url":"https://api.github.com/repos/rails/sprockets/issues/252","repository_url":"https://api.github.com/repos/rails/sprockets","labels_url":"https://api.github.com/repos/rails/sprockets/issues/252/labels{/name}","comments_url":"https://api.github.com/repos/rails/sprockets/issues/252/comments","events_url":"https://api.github.com/repos/rails/sprockets/issues/252/events","html_url":"https://github.com/rails/sprockets/issues/252","id":136200375,"number":252,"title":"Add more context to Sprockets::FileNotFound error messages","user":{"login":"carols10cents","id":193874,"avatar_url":"https://avatars.githubusercontent.com/u/193874?v=3","gravatar_id":"","url":"https://api.github.com/users/carols10cents","html_url":"https://github.com/carols10cents","followers_url":"https://api.github.com/users/carols10cents/followers","following_url":"https://api.github.com/users/carols10cents/following{/other_user}","gists_url":"https://api.github.com/users/carols10cents/gists{/gist_id}","starred_url":"https://api.github.com/users/carols10cents/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carols10cents/subscriptions","organizations_url":"https://api.github.com/users/carols10cents/orgs","repos_url":"https://api.github.com/users/carols10cents/repos","events_url":"https://api.github.com/users/carols10cents/events{/privacy}","received_events_url":"https://api.github.com/users/carols10cents/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-24T22:04:52Z","updated_at":"2016-02-24T22:04:52Z","closed_at":null,"body":"Sort of related to https://github.com/rails/sprockets/issues/251. If the error messages I had gotten had included more information, perhaps it wouldn't matter that the documentation hadn't helped me.\r\n\r\nThis is with a brand new rails 4.2.5.1 app and sprockets 3.5.2.\r\n\r\nThe relevant part of that issue to this issue is that I had a file in `app/assets/other_javascripts/f.js` (a sibling directory to `app/assets/javascripts`, not a subdirectory) and I tried to require it in `app/assets/javascripts/application.js` by adding `require ../other_javascripts/f`. () When I run `rake assets:precompile` in this state, I get this error message:\r\n\r\n```\r\nSprockets::FileNotFound: couldn't find file '../other_javascripts/f' under '/Users/carolnichols/Ruby/sprockets-test-app/app/assets/javascripts' with type 'application/javascript'\r\n```\r\n\r\nNow, 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. \r\n\r\nI *also* happen to know that if I instead use `require f`, sprockets DOES find `app/assets/other_javascripts/f.js`, so it's clearly looking more places.\r\n\r\nIt'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."}}