{"record":{"id":"6faac577f21422e0","repo":"gatsbyjs/gatsby","slug":"did-not-recognize-curr","errorCode":null,"errorMessage":"Did not recognize ${curr}","messagePattern":"Did not recognize (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deprecated-packages/gatsby-recipes/src/providers/gatsby/utils/get-object-from-node.js","lineNumber":51,"sourceCode":"}\n\nconst getObjectFromNode = nodeValue => {\n  if (!nodeValue || !nodeValue.properties) {\n    return getValueFromNode(nodeValue)\n  }\n\n  const props = nodeValue.properties.reduce((acc, curr) => {\n    let value = null\n\n    if (curr.value) {\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\nexport default getObjectFromNode\nexport { getValueFromNode }\n","sourceCodeStart":33,"sourceCodeEnd":63,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/deprecated-packages/gatsby-recipes/src/providers/gatsby/utils/get-object-from-node.js#L33-L63","documentation":"Thrown inside `getObjectFromNode` (get-object-from-node.js:51) during the gatsby-recipes AST reader. For each property of an object expression, if `curr.value` is falsy OR not an ObjectExpression handled by the prior branch, the node type is unrecognized and the conversion aborts. The error stringifies the raw Babel AST node, making it useful for diagnostics.","triggerScenarios":"Recipe config containing a property whose value is a node type the reader does not handle — e.g. a SpreadElement, an ArrayExpression of non-literals, a ConditionalExpression, a TemplateLiteral with interpolation, or a property shorthand.","commonSituations":"Writing plugin options in gatsby-config.js that use spreads (`...baseOptions`), ternaries, or computed keys that gatsby-recipes' static reader was not taught to parse; adding novel plugin option shapes.","solutions":["Inspect the stringified `${curr}` node in the error to identify the offending property and its node type.","Rewrite that option as a plain literal/object literal so the reader can convert it.","Remove spread elements or dynamic expressions from plugin option objects consumed by recipes."],"exampleFix":"// before — spread element not handled\n{\n  resolve: `gatsby-source-filesystem`,\n  options: { ...defaults, path: `${__dirname}/src` },\n}\n\n// after — literal object\n{\n  resolve: `gatsby-source-filesystem`,\n  options: { name: `src`, path: `${__dirname}/src` },\n}","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['StringLiteral','NumericLiteral','BooleanLiteral','NullLiteral','ObjectExpression','ArrayExpression']\nfunction objectPropsAreSupported(objectExprNode) {\n  return objectExprNode.properties.every(p =>\n    p.type === 'ObjectProperty' && (!p.value || SUPPORTED.includes(p.value.type))\n  )\n}","typeGuard":"function isRecognizableValue(node) {\n  return !node || ['StringLiteral','NumericLiteral','BooleanLiteral','NullLiteral','ObjectExpression','ArrayExpression'].includes(node.type)\n}","tryCatchPattern":null,"preventionTips":["Avoid SpreadElement and dynamic expressions in plugin option objects used by recipes.","Use literal values for plugin options.","Inspect the stringified AST node in the error to diagnose the offending property."],"tags":["recipes","ast","parsing","config","deprecated"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}