This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
Fix errors on section rendering caused by CORS issues #2078
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.
WHY are these changes introduced?
The Dawn 1.1.0 theme relies on data attribute values to re-render sections with JavaScript:
However, when users change product variants, the exact error reported by #1466 happens, as the client-side request fails due to CORS issues.
Regarding my other (reverted) PR
My other PR (#1952) was actually fixing a different problem with less impact. It handled 307 HTTP requests with CORS errors happening only on Safari with some assets.
Those assets do not impact section rendering. So, I've created Shopify/cli#2001 for handling this scenario.
WHAT is this pull request doing?
This PR adopts a similar approach from the other middlewares and replaces shop URLs from templates, pointing them to
127.0.0.1:9292
.How to test your changes?
git clone git@github.com:Shopify/dawn.git
git reset 2566749e4226818500809892259b7713808319ae --hard
shopify theme serve
Before this PR:
After this PR:
Post-release steps
None.
Update checklist