{"record":{"id":"6ef815aeee3df028","repo":"gatsbyjs/gatsby","slug":"11334","errorCode":"11334","errorMessage":"${pluginName} must set the slice id when creating a slice.\\n\\nThe slice object passed to createSlice:\\n${sliceObject}","messagePattern":"(.+?) must set the slice id when creating a slice\\.\\\\n\\\\nThe slice object passed to createSlice:\\\\n(.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/redux/actions/restricted.ts","lineNumber":473,"sourceCode":"   *     id: `navigation-bar`,\n   *     component: path.resolve(`./src/components/navigation-bar.js`),\n   *   })\n   * }\n   */\n  createSlice: (\n    payload: ICreateSliceInput,\n    plugin: IGatsbyPlugin,\n    traceId?: string\n  ): ICreateSliceAction => {\n    if (_CFLAGS_.GATSBY_MAJOR === `5` && process.env.GATSBY_SLICES) {\n      let name = `The plugin \"${plugin.name}\"`\n      if (plugin.name === `default-site-plugin`) {\n        name = `Your site's \"gatsby-node.js\"`\n      }\n\n      if (!payload.id) {\n        const message = `${name} must set the page path when creating a slice`\n        report.panic({\n          id: `11334`,\n          context: {\n            pluginName: name,\n            sliceObject: payload,\n            message,\n          },\n        })\n      }\n\n      const { slices } = store.getState()\n\n      const { error, panicOnBuild } = validateComponent({\n        input: payload,\n        pluginName: name,\n        errorIdMap: {\n          noPath: `11333`,\n          notAbsolute: `11335`,\n          doesNotExist: `11336`,","sourceCodeStart":455,"sourceCodeEnd":491,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/8b06340921ffdf23125a365b9c9923690cb62ce6/packages/gatsby/src/redux/actions/restricted.ts#L455-L491","documentation":"Thrown by the createSlice action when payload.id is falsy. Slices (Gatsby v5, behind GATSBY_SLICES) require an id; omitting it panics with code 11334, including the offending slice object and the plugin name. Note: the inner message string reuses 'page path' wording even though this is the slice-id check (a copy-paste artifact in the source).","triggerScenarios":"A call to actions.createSlice where payload.id is undefined/null/empty; the !payload.id branch fires inside the GATSBY_MAJOR===5 && GATSBY_SLICES guard.","commonSituations":"Adopting Slices and forgetting to set id; using a data field for id that is null for some records; misreading the API and passing `name` instead of `id`.","solutions":["Pass a stable, unique non-empty `id` string in every createSlice call.","Derive id from your data (e.g. slice.id = `header` or `${template}-${locale}`) and ensure it is never null.","Enable Slices explicitly via GATSBY_SLICES=true on Gatsby v5+."],"exampleFix":"// before\nactions.createSlice({ component, context })\n// after\nactions.createSlice({ id: `site-header`, component, context })","handlingStrategy":"validation","validationCode":"if (!payload.id || typeof payload.id !== 'string') {\n  throw new Error('createSlice requires a non-empty id string')\n}\nactions.createSlice(payload)","typeGuard":"function hasSliceId(p): p is { id: string } {\n  return typeof p?.id === 'string' && p.id.length > 0\n}","tryCatchPattern":null,"preventionTips":["Always pass a stable unique id for slices.","Derive ids from guaranteed non-null data fields.","Enable GATSBY_SLICES=true on Gatsby v5+ before using createSlice."],"tags":["slices","createslice","validation","v5"],"backgroundTag":null,"analyzedSha":"8b06340921ffdf23125a365b9c9923690cb62ce6","analyzedAt":"2026-08-13T02:36:21.405Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}