Shopify run dev CLI error - Cannot read properties of undefined (reading 'forEach')

Topic summary

Shopify CLI crashes with the error “Cannot read properties of undefined (reading ‘forEach’)” when working with extensions, notably after adding a Checkout UI extension.

  • Impacted commands: npm run dev (after adding a checkout UI extension) and npm run generate extension (when starting by adding the first extension instead of the Remix option).
  • Environment reported: macOS, Node.js v18, Shopify CLI v3.53.1.
  • Troubleshooting tried: – --reset flag and reinstalling the CLI; issue persists.
  • Verbose output: last GraphQL calls observed are FindApp and allAppExtensionRegistrations before the crash.
  • Reproduction path noted: create app via “npm init @shopify[email removed] (user typed @Shopify_77 [email removed] choose “Start by adding your first extension,” then run npm run generate extension → same error.

No workaround or fix identified in the thread. Likely a CLI regression related to extension scaffolding/registration. Screenshot/logs are central to understanding the failure. Discussion remains open with unresolved cause.

Summarized with AI on January 7. AI used: gpt-5.

Hello,

I’m having error running my npm run dev scripts. It was running fine at first, and then I ran new extension for checkout ui, after that it crashes everytime I run it. I tried running it with – --reset and tried reinstalling CLI with no luck.

When running --verbose
query FindApp and query allAppExtensionRegistrations was the last few queries being made.

Im running macOS and node version 18 CLI version 3.53.1

2 Likes

Having the same issue. But for me to recreate, I created the app with “npm init @Shopify_77 /app@latest” and for get started building your app, instead of the remix option I chose Start by adding your first extension. Once I try to run npm run generate extension it throws me that same error.

1 Like