gatsbyjs/gatsby · error

11610

11610

Error message

11610

What it means

Structured error 11610 from `gatsby new`. Fires when the resolved `rootPath` parses as a URL (has protocol and host) AND contains the string `gatsby-starter`, while the `starter` argument itself is not a URL. This pattern indicates the user swapped the two positional arguments of `gatsby new`, putting the starter URL in the project-name slot.

Source

Thrown at packages/gatsby-cli/src/init-starter.ts:296

    starter,
    root
  )

  const urlObject = url.parse(rootPath)

  if (selectedOtherStarter) {
    report.info(
      `Opening the starter library at https://gatsby.dev/starters?v=2...\nThe starter library has a variety of options for starters you can browse\n\nYou can then use the gatsby new command with the link to a repository of a starter you'd like to use, for example:\ngatsby new ${rootPath} https://github.com/gatsbyjs/gatsby-starter-default`
    )
    opn(`https://gatsby.dev/starters?v=2`)
    return
  }
  if (urlObject.protocol && urlObject.host) {
    const isStarterAUrl =
      starter && !url.parse(starter).hostname && !url.parse(starter).protocol

    if (/gatsby-starter/gi.test(rootPath) && isStarterAUrl) {
      report.panic({
        id: `11610`,
        context: {
          starter,
          rootPath,
        },
      })
      return
    }
    report.panic({
      id: `11611`,
      context: {
        rootPath,
      },
    })
    return
  }

  if (!isValid(rootPath)) {

View on GitHub (pinned to 8b06340921)

Solutions

  1. Use the correct argument order: `gatsby new <project-name> <starter-url>`.
  2. If you only want a starter, run `gatsby new <project-name>` and pick the starter interactively.
  3. Double-check the first positional is a local directory name, not a URL.

Example fix

# before (swapped)
gatsby new https://github.com/gatsbyjs/gatsby-starter-blog my-blog

# after
gatsby new my-blog https://github.com/gatsbyjs/gatsby-starter-blog
Defensive patterns

Strategy: validation

Validate before calling

const url = require('url')
function assertNewArgs(rootPath, starter) {
  const r = url.parse(rootPath)
  if (r.protocol && r.host) throw new Error('First arg must be a project name, not a URL')
}

Prevention

When it happens

Trigger: Invoking `gatsby new https://github.com/gatsbyjs/gatsby-starter-blog my-blog` in the wrong order, or `gatsby new my-blog https://.../gatsby-starter-blog` where args got reordered so the URL lands in rootPath. The check `/gatsby-starter/gi.test(rootPath) && isStarterAUrl` detects the swapped-args case specifically.

Common situations: Misreading the `gatsby new <root> [starter]` argument order; copy-pasting a starter URL into the first prompt/position; shell aliases or scripts that reorder the args.

Related errors


AI-assisted analysis of gatsbyjs/gatsby@8b06340921 (2026-08-13). Data as JSON: /api/errors/e5e9471304d59ac2. Report an issue: GitHub.