Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you run your app locally with this fix? Aren’t there other places where the Webpacker constant is being referenced? Curious if this would fix the initial error but make way for another.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here for example:
wicked_pdf/lib/wicked_pdf/wicked_pdf_helper/assets.rb
Line 226 in 4abf255
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
Yes I monkey patched it in my app, and it is working properly, running in production.
As I have stated in my PR description above:
require 'webpacker/version'
webpacker/version
would be present anyway, no need to require it again.)Webpacker
in code, but you will get one when you try to requirewebpacker/version
.This is happening because Shakapacker decided to slowly rename everything "webpacker" to "shakapacker" in their codebase. At the moment they are trying to provide backwards compatibility.
Webpacker
doesn't raise an error. When usingshakapacker
version7
.webpacker/version
, because no such file exists. You would need to requireshakapacker/version
undershakapacker
version7
.If you do not like the idea of removing that require statement, then I can change my fix to the following:
To clarify once more, wicked_pdf aside from this one line of code (
require 'webpacker/version'
) isshakapacker
version7
compatible. If we remove or change this line in the above mentioned way, then we end up with full compatibility.This full compatibility is the goal of my current PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@unixmonkey @AJFaraday I'm not sure how this was tested, but this is not working for us. We currently have version 2.6.3, and the change to 2.7.0 fails with an uninitialized constant Webpacker::VERSION error.
The same happens when I load the rails console and try to access the constant.
Note that nowhere in the webpacker code I see the require of the version file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sk- I would be happy to take a fix PR.