-
Notifications
You must be signed in to change notification settings - Fork 789
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
4.0.0.beta9 causes Sprockets::FileNotFound for vendor asset #613
Comments
A similar issue has been reported in #609. |
Can you provide an example app that reproduces the problem?
--
Richard Schneeman
https://www.schneems.com
|
I can't reproduce it in the standalone app, but it looks like the cache key for the unloaded asset is wrong on 4.0.0.beta9 vs beta8. If I inspect the # beta8
=> "asset-uri-cache-dependencies:vendor/assets/javascripts/jquery.js?type=application/javascript&pipeline=source:\xB0\xCFb0,\xF8\xAA\x19,\xDA$\xA02\xF3\x0EJ\x82N\xFD\xF3\xF0gL\xC8\xBC\xE3;a\xB2W\xD6\x06"
# beta9
=> "asset-uri-cache-dependencies:vendor/assets/javascripts/jquery.js?type=application/javascript&pipeline=source:" If I manually fix the key to the beta8 value using pry on beta9, then the asset is found in the cache: pry(#<Sprockets::CachedEnvironment>)> cache.get "asset-uri-cache-dependencies:vendor/assets/javascripts/jquery.js?type=application/javascript&pipeline=source:\xB0\xCFb0,\xF8\xAA\x19,\xDA$\xA02\xF3\x0EJ\x82N\xFD\xF3\xF0gL\xC8\xBC\xE3;a\xB2W\xD6\x06"
=> [#<Set: {"environment-version",
"environment-paths",
"rails-env",
"processors:type=application/javascript&file_type=application/javascript&pipeline=source",
"file-digest://vendor/assets/javascripts/jquery.js"}>] |
OK, it looks like # beta8
=> "/Users/felix/dev/sites/myapp/vendor/assets/javascripts/jquery.js"
# beta9
=> "/assets/javascripts/jquery.js" This causes the call to |
Also the # beta8
=> "file:///Users/felix/dev/sites/myapp/vendor/assets/javascripts/jquery.js?type=application/javascript&pipeline=source"
# beta9
=> "file://vendor/assets/javascripts/jquery.js?type=application/javascript&pipeline=source" So it looks like on beta8 the path is absolute, while on beta9 it is relative to the rails root. |
That's a bug likely due to
36741c6,
can you give me an example app that reproduces the issue?
https://www.codetriage.com/example_app
…On Thu, Jun 13, 2019 at 10:59 AM Felix Bünemann ***@***.***> wrote:
Also the uri differs, which is used to derive the filename:
# beta8"file:///Users/felix/dev/sites/myapp/vendor/assets/javascripts/jquery.js?type=application/javascript&pipeline=source"# beta9
=> "file://vendor/assets/javascripts/jquery.js?type=application/javascript&pipeline=source"
So it looks like on beta8 the path is absolute, while on beta9 it is
relative to the rails root.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#613?email_source=notifications&email_token=AAAOSYD754SR4ILOH5GWYHTP2JVETA5CNFSM4HXXYD32YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXUFLQI#issuecomment-501765569>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAOSYGS4W4RQHBOD6OU7O3P2JVETANCNFSM4HXXYD3Q>
.
--
Richard Schneeman
https://www.schneems.com
|
@schneems As I've written before, I couldn't reproduce the bug in a standalone app yet. It looks like all the |
@schneems Found it, there's a missing line in expand_key_from_hash(asset[:metadata], :links) I'll make a PR with the bugfix. |
Right you are, good find! Thanks a ton for reporting and investigating! Would love to add a general purpose test for the expansion behavior. We have one for compression behavior here https://github.com/rails/sprockets/pull/547/files#diff-89c067b041f282dfcf6e1a6725536317R432 |
After upgrading from Sprockets 4.0.0.beta8 to 4.0.0.beta9 I receive the following error:
After dissecting the git history I found the following commit to cause the problem 36741c6 (Thread-safe cache loader) and the last working commit to be 1844ee9.
I'm using Sprockets with Rails 5.2.3 on Ruby 2.6.1 on macOS 10.14.
The text was updated successfully, but these errors were encountered: