gatsbyjs/gatsby · error · MissingInfoError

MissingInfoError

Error message

MissingInfoError

What it means

Thrown by the gatsby-recipes Gatsby plugin provider when `options.accessToken === '(Known after install)'` (plugin.js:270 region). `MissingInfoError` is a custom error whose `foo` field carries `{name, options, key}` and signals that the recipe needs an access token that has not yet been supplied. This is a demo-specific guard inside Gatsby Admin's recipe flow.

Source

Thrown at deprecated-packages/gatsby-recipes/src/providers/gatsby/plugin.js:270

    super(...params)

    // Maintains proper stack trace for where our error was thrown (only available on V8)
    if (Error.captureStackTrace) {
      Error.captureStackTrace(this, MissingInfoError)
    }

    this.name = `MissingInfoError`
    // Custom debugging information
    this.foo = foo
    this.date = new Date()
  }
}

const create = async ({ root }, { name, options, key }) => {
  const release = await lock(`gatsby-config.js`)
  // TODO generalize this — it's for the demo.
  if (options?.accessToken === `(Known after install)`) {
    throw new MissingInfoError({ name, options, key })
  }
  const configSrc = await readConfigFile(root)
  const prettierConfig = await prettier.resolveConfig(root)

  let code = addPluginToConfig(configSrc, { name, options, key })
  code = prettier.format(code, { ...prettierConfig, parser: `babel` })

  await fs.writeFile(getConfigPath(root), code)

  const config = await read({ root }, key || name)
  release()
  return config
}

const read = async ({ root }, id) => {
  try {
    const configSrc = await readConfigFile(root)

View on GitHub (pinned to 8b06340921)

Solutions

  1. Provide a real `accessToken` value in the recipe options instead of the `(Known after install)` placeholder.
  2. If using Gatsby Admin, complete the credential entry step before invoking the plugin-add recipe.
  3. Catch `MissingInfoError` by name (err.name === 'MissingInfoError') and prompt the user for the token.

Example fix

// before
create({ root }, { name: `gatsby-source-contentful`, options: { accessToken: `(Known after install)` } })

// after
create({ root }, { name: `gatsby-source-contentful`, options: { accessToken: process.env.CONTENTFUL_TOKEN } })
Defensive patterns

Strategy: validation

Validate before calling

const PLACEHOLDER = `(Known after install)`
function hasRealAccessToken(options) {
  return options && options.accessToken && options.accessToken !== PLACEHOLDER
}
if (!hasRealAccessToken(opts)) { /* prompt user, do not call create() */ }

Type guard

function isMissingInfoError(e) {
  return e && e.name === `MissingInfoError`
}

Try / catch

try {
  await create({ root }, { name, options, key })
} catch (e) {
  if (e.name === `MissingInfoError`) {
    // prompt user for accessToken, then retry
  } else throw e
}

Prevention

When it happens

Trigger: Running a Gatsby Admin recipe that adds a plugin requiring an `accessToken`, where the placeholder string `(Known after install)` was passed instead of a real value; invoking the recipe `create` step before the user has entered credentials.

Common situations: Using Gatsby Admin's guided plugin install flow where the token field is deferred; copy-pasting a recipe config containing the placeholder text; running recipes headlessly without supplying required secrets.

Related errors


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