You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sections can contain both .liquid and .json files. The .json files reference the .liquid files as a way to group them together. If a .json file is uploaded before the .liquid file is uploaded, a 422 Unprocessable Entity error is thrown.
Example
header-group.json and header.liquid are both stored in the /sections folder and are uploaded in this order.
<h1>This is the header</h1>
{% schema %}
{
"name": "Header",
"class": "section-header",
"settings": []
}
Failed
Success
The Cause
When uploading a theme, Syncify iterates through the files in alphabetical order (presumably). Because header-group.json is uploaded before header.liquid, the referenced section doesn't exist on the store.
If we were to run the upload argument again, it'll work, since the file is now present from the previous upload job.
Solution
Syncify should iterate through all the .liquid files first, then iterate through the .json files.
The text was updated successfully, but these errors were encountered:
Dev Build
If I were to run syncify store --theme dev --watch --hot, once I save the json file, I'll see this error since the liquid file will not exist. It would be as simple as saving the referenced file and we'll be good again. I don't think it's Syncify's job to handle this here, it's a waste of time.
Production Build
Now, if I were to run syncify store --theme dev --upload, I'll run into the problem. So I'd say the --upload flag needs to deal with this.
Problem
Sections can contain both
.liquid
and.json
files. The.json
files reference the.liquid
files as a way to group them together. If a.json
file is uploaded before the.liquid
file is uploaded, a 422 Unprocessable Entity error is thrown.Example
header-group.json
andheader.liquid
are both stored in the/sections
folder and are uploaded in this order.header-group.json
header.liquid
The Cause
When uploading a theme, Syncify iterates through the files in alphabetical order (presumably). Because
header-group.json
is uploaded beforeheader.liquid
, the referenced section doesn't exist on the store.If we were to run the upload argument again, it'll work, since the file is now present from the previous upload job.
Solution
Syncify should iterate through all the
.liquid
files first, then iterate through the.json
files.The text was updated successfully, but these errors were encountered: