{"record":{"id":"9c101237c1d0603c","repo":"gatsbyjs/gatsby","slug":"did-not-recognize-curr-9c1012","errorCode":null,"errorMessage":"Did not recognize ${curr}","messagePattern":"Did not recognize (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby-cli/src/handlers/plugin-babel-utils.ts","lineNumber":34,"sourceCode":"const getObjectFromNode = (nodeValue: any): any => {\n  if (!nodeValue || !nodeValue.properties) {\n    // eslint-disable-next-line @typescript-eslint/no-use-before-define\n    return getValueFromNode(nodeValue)\n  }\n\n  const props = nodeValue.properties.reduce((acc, curr) => {\n    let value = null\n\n    if (curr.value) {\n      // eslint-disable-next-line @typescript-eslint/no-use-before-define\n      value = getValueFromNode(curr.value)\n    } else if (t.isObjectExpression(curr.value)) {\n      value = curr.value.expression.properties.reduce((acc, curr) => {\n        acc[getKeyNameFromAttribute(curr)] = getObjectFromNode(curr)\n        return acc\n      }, {})\n    } else {\n      throw new Error(`Did not recognize ${curr}`)\n    }\n\n    acc[getKeyNameFromAttribute(curr)] = value\n    return acc\n  }, {})\n\n  return props\n}\n\nconst getValueFromNode = (node: any): any => {\n  if (t.isTemplateLiteral(node)) {\n    // @ts-ignore - fix me\n    delete node.leadingComments\n    // @ts-ignore - fix me\n    delete node.trailingComments\n    // @ts-ignore - fix me\n    const literalContents = generate(node).code\n    return unwrapTemplateLiteral(literalContents)","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby-cli/src/handlers/plugin-babel-utils.ts#L16-L52","documentation":"Thrown by the plugin-babel-utils AST reducer when it encounters an object property node that has neither a recognized value nor a nested ObjectExpression. The reducer walks plugin option nodes parsed from babel and only knows how to extract literal/template values; any other AST shape is rejected so silently-wrong option extraction cannot happen.","triggerScenarios":"Invoking getValueFromNode/reduce over a babel-parsed plugin options object whose property is a SpreadElement, computed key, method shorthand, or other non-literal node (curr.value falsy and not an ObjectExpression). Happens when gatsby-cli scans a gatsby-config.js whose plugin options contain function expressions, spreads, or computed keys the parser does not handle.","commonSituations":"Migrating a config that uses a spread (`...baseOptions`) or a function value inside a plugin's options; upgrading gatsby-cli to a version whose babel-utils grammar is stricter; running `gatsby plugin` introspection or telemetry over a non-trivial config.","solutions":["Inspect the offending property node (the `${curr}` stringified in the message) to identify which option key triggered it.","Rewrite that option as a plain literal, array, or nested object literal so the reducer recognizes it.","If a spread is needed, inline the spread values into the plugin options object.","Move function-valued options out of the statically-parsed config or guard them with a shape the reducer supports."],"exampleFix":"// before: plugin option uses a spread the reducer cannot parse\nplugins: [{ resolve: 'x', options: { ...shared, foo: 'bar' } }]\n// after: inline the values\nplugins: [{ resolve: 'x', options: { base: 'cfg', foo: 'bar' } }]","handlingStrategy":"validation","validationCode":"// before calling the reducer, ensure option properties are literal-shaped\nconst isLiteralOption = (node) =>\n  !node.value || t.isObjectExpression(node.value) || t.isLiteral(node.value) || t.isTemplateLiteral(node.value)","typeGuard":"const isRecognizedProperty = (curr): boolean =>\n  !!curr.value || t.isObjectExpression(curr.value)","tryCatchPattern":"try {\n  props = nodeValue.properties.reduce(reducer, {})\n} catch (e) {\n  // fall back to skipping the unrecognized option rather than aborting\n  report.warn(`Skipping unrecognized plugin option node: ${e.message}`)\n}","preventionTips":["Keep plugin options in gatsby-config.js as plain literals/arrays/objects.","Avoid spreads and function values inside statically-parsed plugin options.","Test config changes with the consuming CLI before committing."],"tags":["babel","ast","plugin-options","gatsby-cli"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}