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.
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.
1 Like