{"record":{"id":"489def818ad506ab","repo":"gatsbyjs/gatsby","slug":"no-support-for-arrays-not-at-the-end-of-path","errorCode":null,"errorMessage":"No support for arrays not at the end of path","messagePattern":"No support for arrays not at the end of path","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/bootstrap/load-plugins/validate.ts","lineNumber":271,"sourceCode":"                    const resolvedPlugin = resolvePlugin(value, rootDir)\n                    const modulePath = require.resolve(\n                      `${resolvedPlugin.resolve}${entry ? `/${entry}` : ``}`\n                    )\n                    value.modulePath = modulePath\n\n                    const normalizedPath = helpers.state.path\n                      .map((key, index) => {\n                        // if subplugin is part of an array - swap concrete index key with `[]`\n                        if (\n                          typeof key === `number` &&\n                          Array.isArray(\n                            helpers.state.ancestors[\n                              helpers.state.path.length - index - 1\n                            ]\n                          )\n                        ) {\n                          if (index !== helpers.state.path.length - 1) {\n                            throw new Error(\n                              `No support for arrays not at the end of path`\n                            )\n                          }\n                          return `[]`\n                        }\n\n                        return key\n                      })\n                      .join(`.`)\n\n                    subPluginPaths.add(normalizedPath)\n                  } catch (err) {\n                    console.log(err)\n                  }\n\n                  return value\n                })\n              }, `Gatsby specific subplugin validation`)","sourceCodeStart":253,"sourceCodeEnd":289,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby/src/bootstrap/load-plugins/validate.ts#L253-L289","documentation":"While validating nested sub-plugins, Gatsby builds a dotted path and collapses terminal array indices to `[]`. A numeric path segment that is NOT the last segment (i.e. an array nested deeper than the end of the path) has no supported string representation, so validation aborts.","triggerScenarios":"A plugin whose `options` schema contains a nested array of sub-plugins that itself sits inside another array/object, so the array index appears before the final path key (e.g. `plugins.options.things[0].plugins[0]`).","commonSituations":"Authoring a plugin that exposes its own `plugins` option structured as arrays-inside-arrays; unusual custom plugin option schemas.","solutions":["Restructure the plugin's `subPluginPaths`/options so any array of sub-plugins is the terminal element of the config path.","If you do not control the plugin, simplify the config to avoid nested arrays of plugins.","Report the schema shape to the plugin author; this is a structural limitation, not a typo."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// For plugin authors: keep arrays of sub-plugins terminal in the options path.\n// Validate your schema so nested arrays of plugins are rejected up front:\nconst BAD = /\\.\\d+\\.[^.]+$/ // numeric segment not at end\nfunction assertFlatSubplugins(optionPath) {\n  if (/\\.\\d+\\./.test(optionPath) && !optionPath.endsWith(\"[]\")) {\n  throw new Error(`Unsupported nested subplugin array at ${optionPath}`)\n  }\n}\n","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Design plugin option schemas so any `plugins` array is the last path segment.","Document supported sub-plugin shapes to users."],"tags":["plugins","config","validation","joi","internal"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}