-
Notifications
You must be signed in to change notification settings - Fork 22
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
Exclude Sprockets 4 manifest.js by default #48
Comments
Ping, any ideas here, could there be a problem in this gem? Does shopify still use this gem? cc/ @bouk @TylerHorth |
Weird. We do use this gem and we also use the manifest file even with sprockets 3 and we don't see this error in our application. Maybe something changed in sprockets or sprockets-rails that is including the manifest file in the bundle? |
Yes, we still use this gem but I don't think we currently have an application that's being deployed with it and Sprockets 4 @amiuhle could you provide some more information on when this happens and what your application looks like? I assumed this would happen when precompiling the assets, but I can't reproduce it |
The issue seems to be cache related. The problem only happens on the second push. I'm shooting in the dark here, but maybe shopify deploys with the same absolute path to the cache? Versus this app is running on Heroku and gets a different path on each deploy. |
# sprockets/uri_utils.rb
def parse_asset_uri(uri)
scheme, _, path, query = split_file_uri(uri)
unless scheme == 'file'
raise URI::InvalidURIError, "expected file:// scheme: #{uri}"
end
return path, parse_uri_query_params(query)
end Might be worth throwing a debugger in there and seeing what the uri is before the exception is raised. Might give us some hints towards what is actually going wrong here. |
I just tried to reproduce this, but couldn't... I don't think it's worth putting any more effort into this, at least if someone else has the same problem, they'll find the workaround above. If you agree, you can close this. Thanks for the feedback! |
@TylerHorth uri is in the exception output alread. I think it's either false or nil or empty string: raise URI::InvalidURIError, "expected file:// scheme: #{uri}"
# => "URI::InvalidURIError: expected file:// scheme: " |
Ah. You're right, I missed that. It's probably nil since that's what I don't have enough knowledge of commoner to make a guess as to what could have gone wrong, but if it can no longer be reproduced it's probably not worth more investigation. |
I just ran into this issue and I'm wondering if it's related to an issue I ran into here: |
Full stack here: https://gist.github.com/dimroc/7cedcf211e966fb1065b18ce3313fc79 |
Ohhh I just realized we don't run into this because our manifest.js is not included in our commoner compilation. I can probably reproduce this now |
I've never run into this locally, only when deploying to Heroku. For anyone else that stumbles into this, you can get by with |
Same problem over here. @dimroc's solution works everytime for me as a crutch. Is there a more permanent solution that anyone has found? |
For anyone else frustrated by this, I got around the problem by not using the new manifest.js and returning to the Rails.application.config.assets.version = '1.1.5'
Rails.application.config.assets.precompile += [
%w{client.js vendor.js},
%w{admin.css dealership.css}
].flatten |
Got this issue today and @dimroc's solution worked. But we need to install Heroku Repo plugin first |
Using Sprockets
4.0.0.beta4
, I got the error below when trying to deploy. Indevelopment
, everything worked fine, and addingexclude: ['vendor/bundle', 'app/assets/config']
in the initializer helped.app/assets/config/manifest.js
:The text was updated successfully, but these errors were encountered: