gulp-shopify-theme icon indicating copy to clipboard operation
gulp-shopify-theme copied to clipboard

New valid JSON templates throw 422 Unprocessable Entity error

Open eballeste opened this issue 2 years ago • 4 comments

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.

eballeste avatar Aug 16 '21 23:08 eballeste

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:

  • A problem in the file's schema
  • A liquid template with the same name as the .json file
  • anything else that's triggering Shopify's API to complain

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

tmslnz avatar Aug 18 '21 13:08 tmslnz

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.

eballeste avatar Aug 19 '21 05:08 eballeste

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.

tmslnz avatar Aug 19 '21 09:08 tmslnz

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

eballeste avatar Aug 19 '21 16:08 eballeste