gatsbyjs/gatsby · error

11611

11611

Error message

11611

What it means

Structured error 11611 from `gatsby new`. Fires when `rootPath` parses as a URL (has protocol and host) but does not match the 11610 swapped-args pattern. The project name slot contains a URL, which is not a valid local directory, so scaffolding refuses to proceed.

Source

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

    )
    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)) {
    report.panic({
      id: `11612`,
      context: {
        path: sysPath.resolve(rootPath),
      },
    })
    return
  }

View on GitHub (pinned to 8b06340921)

Solutions

  1. Provide a valid local directory name as the first argument: `gatsby new my-site`.
  2. If you intended to clone a starter, put its URL second: `gatsby new my-site <starter-url>`.
  3. Remove any `https://` prefix from the project name.

Example fix

# before
gatsby new https://example.com

# after
gatsby new my-site
Defensive patterns

Strategy: validation

Validate before calling

const url = require('url')
function isValidRoot(p) { return !url.parse(p).protocol }

Type guard

const isNonUrlPath = (v: unknown): v is string => typeof v === 'string' && !/:\/\//.test(v)

Prevention

When it happens

Trigger: The first positional argument to `gatsby new` is a URL or URL-like string (e.g. `gatsby new https://example.com`). Since a URL cannot be a filesystem directory, `initStarter` panics.

Common situations: Passing a URL as the project name; misunderstanding the `gatsby new` argument order; copy-paste error where the starter URL goes into the root slot.

Related errors


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