{"record":{"id":"3c56ad09f6ef3a0b","repo":"gatsbyjs/gatsby","slug":"slice-concreteslicename-for-slicename-sl","errorCode":null,"errorMessage":"Slice \"${concreteSliceName}\" for \"${sliceName}\" slot not found","messagePattern":"Slice \"(.+?)\" for \"(.+?)\" slot not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/cache-dir/slice/inline-slice.js","lineNumber":19,"sourceCode":"import React, { useContext } from \"react\"\nimport { SlicesMapContext, SlicesResultsContext } from \"./context\"\n\nexport const InlineSlice = ({\n  sliceName,\n  allowEmpty,\n  children,\n  ...sliceProps\n}) => {\n  const slicesMap = useContext(SlicesMapContext)\n  const slicesResultsMap = useContext(SlicesResultsContext)\n  const concreteSliceName = slicesMap[sliceName]\n  const slice = slicesResultsMap.get(concreteSliceName)\n\n  if (!slice) {\n    if (allowEmpty) {\n      return null\n    } else {\n      throw new Error(\n        `Slice \"${concreteSliceName}\" for \"${sliceName}\" slot not found`\n      )\n    }\n  }\n\n  return (\n    <slice.component\n      sliceContext={slice.sliceContext}\n      data={slice.data}\n      {...sliceProps}\n    >\n      {children}\n    </slice.component>\n  )\n}\n","sourceCodeStart":1,"sourceCodeEnd":35,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby/cache-dir/slice/inline-slice.js#L1-L35","documentation":"Thrown by InlineSlice (the browser/dev-ssr Slice renderer) when the concrete slice name resolved from slicesMap does not have a corresponding entry in slicesResultsMap. The Slice alias is mapped to a concrete component name, and the results map should contain the compiled slice with its component and data. If the result is missing and allowEmpty is false, the error fires.","triggerScenarios":"An <Slice alias='header' /> renders in the browser. slicesMap['header'] resolves to a concrete name, but slicesResultsMap.get(concreteSliceName) returns undefined — meaning the slice data/component was not collected or passed into the results context. This happens when the slice was registered but not built, or the results context is incomplete.","commonSituations":"A Slice was defined in gatsby-node.js but the component file errored during build (so no result was generated), a slice alias mismatch between define and usage, the SlicesResultsContext provider was not set up correctly, or a partial hydration boundary excluded the slice's data.","solutions":["Verify the slice alias in <Slice alias='...' /> matches the alias defined in gatsby-node.js.","Check build logs for errors on the slice's component file — a build error means no result is generated.","Run `gatsby clean` and rebuild to regenerate slice results.","If the slice is optional, pass allowEmpty={true} to render null instead of throwing."],"exampleFix":"// before — slice alias mismatch or missing slice\n<Slice alias=\"site-header\" />\n// but gatsby-node.js defines: defineSlice('header', ...)\n\n// after — match the alias exactly\n<Slice alias=\"header\" />\n\n// or, if the slice is optional:\n<Slice alias=\"header\" allowEmpty={true} />","handlingStrategy":"validation","validationCode":"// Verify slice results exist before rendering\nimport { SlicesResultsContext } from './slice/context'\n\nfunction useSliceResult(sliceName) {\n  const resultsMap = React.useContext(SlicesResultsContext)\n  const slice = resultsMap.get(sliceName)\n  if (!slice) {\n    console.warn(`Slice \"${sliceName}\" not found in results map`)\n    return null\n  }\n  return slice\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure slice alias names match exactly between <Slice alias='...' /> and defineSlice.","Use allowEmpty={true} for optional slices that may not have data.","Check build logs for slice component errors — a build failure means no result is generated.","Run `gatsby clean` to regenerate slice results after structural changes."],"tags":["slices","inline-slice","browser","results-map","alias"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}