cli: [Bug]: Yarn berry can't be used, please bump oclif version and change `config.plugins` to `[...config.plugins.values()]`

Please confirm that you have:

  • Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
  • Reproduced the issue in the latest CLI version.

In which of these areas are you experiencing a problem?

App

Expected behavior

I can run yarn shopify app dev with yarn berry (yarn v3/v4)

Actual behavior

Before you update @oclif/core:

╭─ error ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                              │
│  command app:dev not found                                                                                                                                                   │
│                                                                                                                                                                              │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

After you update @oclif/core to at least 3.4.1-dev.0:

╭─ error ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                │
│  config.plugins.map is not a function                                                                                                          │
│                                                                                                                                                │
│  To investigate the issue, examine this stack trace:                                                                                           │
│    at registerCleanBugsnagErrorsFromWithinPlugins                                                                                              │
│    (.yarn/unplugged/@shopify-cli-kit-npm-3.49.5-f269164f4b/node_modules/@shopify/cli-kit/src/public/node/error-handler.ts:161)                 │
│      config.plugins.map(async (plugin) => {                                                                                                    │
│    at init (.yarn/unplugged/@shopify-cli-kit-npm-3.49.5-f269164f4b/node_modules/@shopify/cli-kit/src/public/node/base-command.ts:39)           │
│      await registerCleanBugsnagErrorsFromWithinPlugins(this.config)                                                                            │
│                                                                                                                                                │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

After you have done this change: https://github.com/oclif/core/pull/839#issuecomment-1772357744, related line in your code: https://github.com/Shopify/cli/blob/0ff99666499ac206ffa0337ae7b36f3555bf1c3d/packages/cli-kit/src/public/node/error-handler.ts#L172

It should work 😃

Reproduction steps

  1. Please see https://github.com/oclif/core/issues/806
  2. If something’s still unclear, please see https://github.com/oclif/core/pull/839

Operating System

macOS 14.0 (23A344)

Shopify CLI version (check your project’s package.json if you’re not sure)

@shopify/cli@3.50.0

Shell

zsh

Node version (run node -v if you’re not sure)

v20.5.0

What language and version are you using in your application?

TypeScript 4.9.4

About this issue

  • Original URL
  • State: closed
  • Created 8 months ago
  • Comments: 17 (9 by maintainers)

Most upvoted comments

Just encountered this issue in the latest @shopify/cli@3.54.0 after bumping. I’m using node v21.5.0 and npm 10.2.4. The error is the following:

> shopify hydrogen dev --codegen --worker

╭─ error ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                          │
│  config.plugins.map is not a function                                                                                                    │
│                                                                                                                                          │
│  To investigate the issue, examine this stack trace:                                                                                     │
│    at registerCleanBugsnagErrorsFromWithinPlugins                                                                                        │
│    (@shopify/cli-hydrogen/node_modules/@shopify/cli-kit/src/public/node/error-handler.ts:170)                                            │
│      config.plugins.map(async (plugin) => {                                                                                              │
│    at init (@shopify/cli-hydrogen/node_modules/@shopify/cli-kit/src/public/node/base-command.ts:40)                                      │
│      await registerCleanBugsnagErrorsFromWithinPlugins(this.config)                                                                      │
│    at async runCLI (@shopify/cli-kit/src/public/node/cli.ts:88)                                                                          │
│      await run(undefined, options.moduleURL)                                                                                             │
│    at async runShopifyCLI (@shopify/cli/src/index.ts:42)                                                                                 │
│      await runCLI({                                                                                                                      │
│                                                                                                                                          │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

Reverting to 3.52.0 fixed the problem.

No timeline yet, still discussing it internally, but I’ll keep this issue open and update it once we have more news Glad that you at least have a workaround 😃

Hi @danieltroger - I just merged that OCLIF PR, version 3.6.0 is published 🚀

thanks for all of your work and back and forth with Mike 😄