tmslnz / gulp-shopify-theme

Shopify theme synchronisation during development
Apache License 2.0
24 stars 6 forks source link

New valid JSON templates throw 422 Unprocessable Entity error #11

Open eballeste opened 3 years ago

eballeste commented 3 years ago

Hi! I've been using this library for years now (thank you) and unfortunately, for some reason, cannot get it to work when trying to upload new Online Store 2.0 JSON template files. It always results in a 422 Unprocessable Entity error.

{
  "layout": "fall-winter-2021",
  "sections": {
    "main": {
      "type": "hero-big-headline"
    }
  },
  "order": [
    "main"
  ]
}

The layout file also exists, the section file hero-big-headline exists, and also saving the same code via the theme's code editor saves just fine. Is it because this lib is expecting these files to be liquid files? Any idea how to spit out the exact error that is causing the error to be triggered? Thanks for any help you might be able to offer.

tmslnz commented 3 years ago

Not sure, sorry! It's been a while since I've done any theme dev.

422 Unprocessable Entity is Shopify's API response as-is, I would imagine the issue may be:

Did you try uploading that file manually via their Theme editor to see if it works or if you get any clearer errors?

eballeste commented 3 years ago

Gotcha, that's unfortunate, saving the json file directly via the theme's code editor throws no errors and I am able to edit and modify it's main sections + add my custom modular sections + reorder them around with no problems.

I'm thinking after so many years using this dev workflow, the time has come to stop using it and adopt Shopify's new git CLI for dev environments / deployment.

tmslnz commented 3 years ago

Ha! It’s probably time. Didn’t even know they released new tools for that. I created this back then precisely because Shopify’s tools were so poor, and I hope the new tools make this package unnecessary.

If anything I would like to update this workflow to be less dependent from a specific tool chain these days.

eballeste commented 3 years ago

i was pretty excited when they announced it during their Unite conference recently.

Updates to dev workflow was just one of many exciting things that are now available including sections in all pages including product pages, not just the homepage.

https://shopify.dev/themes/tools/cli