Code issue

Hi all,

The Shopify Magic ‘Generate theme block’ feature in my theme editor was working fine a few weeks ago, but now I consistently get the error: “Unable to generate theme block at the moment.”

Shopify support told me it’s a code issue in my theme (not an account or platform issue) and that it’ll resolve once the code is fixed — but they couldn’t tell me what specifically needs fixing.

Things I’ve ruled out:

  • Not a session/cache issue (tried hard refresh, different browsers, logging out)
  • Not a usage limit (well past the 7-day window)
  • Not a plan issue (on Basic, but Magic is available on all plans)

My guess from reading Shopify’s docs is that something in my _blocks.liquid wrapper or section schemas isn’t meeting the requirements for AI block generation — but I’m not a developer and don’t know how to verify or fix it.

Has anyone hit this same error and figured out what was causing it? Particularly interested in:

  • Common culprits that break AI block generation
  • Whether there’s a quick diagnostic to identify the broken file
  • What to ask a developer to check first

Thanks for any pointers!

As a test, I’d get a fresh clean copy of the theme from the theme store (and also a different theme, like Horizon or Dawn) and try to generate the same block in these themes.

If these attempts are successful it will confirm that your current theme is the culprit, if not – the theme is not the problem.

Do you have an older copy of your theme?
Can you recall what changes you’ve made to your theme recently – Shopify code editor has edits timeline (unfortunately, per file).
New apps installed?

Hi @info_8697

Common causes that can break Shopify Magic block generation:

  • Invalid JSON inside section/block schema
  • Missing or malformed {% schema %} structure
  • Broken presets/settings definitions
  • Custom _blocks.liquid wrappers
  • Invalid block IDs/types
  • Liquid syntax errors
  • Unsupported section architecture
  • Duplicate schema keys
  • Very heavily customized themes

Best regards,
Devcoder :laptop:

ok thanks good idea I’ll try this and look at my older copies of theme to see if it’s the same there. Thanks!