Starting with Ruby 3.2 – Homebrew formula just says depends_on "ruby", so that’s why such kind of issues appear now – body.join.gsub raises the error invalid byte sequence in UTF-8 when body.join is a font body (which of course doesn’t contain any URLs or other readable characters).
WHAT is this pull request doing?
Does not call replace_asset_urls when path starts with /fonts.
In case other "non-gsubable" strings are being gsubed and the same ArgumentError containing the message invalid byte sequence is raised, body will simply be returned without any replacements.
How to test your changes?
Test it with both Ruby 3.1 and 3.2:
cd into a theme directory
Call DEBUG=true shopify theme serve
Open http://127.0.0.1:9292/
Verify that no Internal server error is thrown
Post-release steps
CLI 3.x update
Update checklist
[x] I've added a CHANGELOG entry for this PR (if the change is public-facing)
[x] I've considered possible cross-platform impacts (Mac, Linux, Windows).
[x] I've left the version number as is (we'll handle incrementing this when releasing).
[x] I've included any post-release steps in the section above (if needed).
WHY are these changes introduced?
Fixes https://github.com/Shopify/cli/issues/1199
Starting with Ruby 3.2 – Homebrew formula just says
depends_on "ruby"
, so that’s why such kind of issues appear now –body.join.gsub
raises the errorinvalid byte sequence in UTF-8
whenbody.join
is a font body (which of course doesn’t contain any URLs or other readable characters).WHAT is this pull request doing?
replace_asset_urls
when path starts with/fonts
.gsub
able" strings are beinggsub
ed and the sameArgumentError
containing the messageinvalid byte sequence
is raised, body will simply be returned without any replacements.How to test your changes?
Test it with both Ruby 3.1 and 3.2:
cd
into a theme directoryDEBUG=true shopify theme serve
http://127.0.0.1:9292/
Post-release steps
Update checklist