{"record":{"id":"fb13129c23f9e980","repo":"gatsbyjs/gatsby","slug":"missinginfoerror","errorCode":null,"errorMessage":"MissingInfoError","messagePattern":"MissingInfoError","errorType":"exception","errorClass":"MissingInfoError","httpStatus":null,"severity":"error","filePath":"deprecated-packages/gatsby-recipes/src/providers/gatsby/plugin.js","lineNumber":270,"sourceCode":"    super(...params)\n\n    // Maintains proper stack trace for where our error was thrown (only available on V8)\n    if (Error.captureStackTrace) {\n      Error.captureStackTrace(this, MissingInfoError)\n    }\n\n    this.name = `MissingInfoError`\n    // Custom debugging information\n    this.foo = foo\n    this.date = new Date()\n  }\n}\n\nconst create = async ({ root }, { name, options, key }) => {\n  const release = await lock(`gatsby-config.js`)\n  // TODO generalize this — it's for the demo.\n  if (options?.accessToken === `(Known after install)`) {\n    throw new MissingInfoError({ name, options, key })\n  }\n  const configSrc = await readConfigFile(root)\n  const prettierConfig = await prettier.resolveConfig(root)\n\n  let code = addPluginToConfig(configSrc, { name, options, key })\n  code = prettier.format(code, { ...prettierConfig, parser: `babel` })\n\n  await fs.writeFile(getConfigPath(root), code)\n\n  const config = await read({ root }, key || name)\n  release()\n  return config\n}\n\nconst read = async ({ root }, id) => {\n  try {\n    const configSrc = await readConfigFile(root)\n","sourceCodeStart":252,"sourceCodeEnd":288,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/deprecated-packages/gatsby-recipes/src/providers/gatsby/plugin.js#L252-L288","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Provide a real `accessToken` value in the recipe options instead of the `(Known after install)` placeholder.","If using Gatsby Admin, complete the credential entry step before invoking the plugin-add recipe.","Catch `MissingInfoError` by name (err.name === 'MissingInfoError') and prompt the user for the token."],"exampleFix":"// before\ncreate({ root }, { name: `gatsby-source-contentful`, options: { accessToken: `(Known after install)` } })\n\n// after\ncreate({ root }, { name: `gatsby-source-contentful`, options: { accessToken: process.env.CONTENTFUL_TOKEN } })","handlingStrategy":"validation","validationCode":"const PLACEHOLDER = `(Known after install)`\nfunction hasRealAccessToken(options) {\n  return options && options.accessToken && options.accessToken !== PLACEHOLDER\n}\nif (!hasRealAccessToken(opts)) { /* prompt user, do not call create() */ }","typeGuard":"function isMissingInfoError(e) {\n  return e && e.name === `MissingInfoError`\n}","tryCatchPattern":"try {\n  await create({ root }, { name, options, key })\n} catch (e) {\n  if (e.name === `MissingInfoError`) {\n    // prompt user for accessToken, then retry\n  } else throw e\n}","preventionTips":["Never pass the `(Known after install)` placeholder to create().","Read secrets from environment variables.","Surface a credential prompt before invoking recipe create for plugins requiring tokens."],"tags":["recipes","gatsby-admin","config","secrets","deprecated"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}