{"record":{"id":"718db474a318190a","repo":"gatsbyjs/gatsby","slug":"non-deterministic-routing-danger-attempting-to-cr","errorCode":null,"errorMessage":"Non-deterministic routing danger: Attempting to create page: \"${page.path}\", but page \"${alternateSlashPath}\" already exists\nThis could lead to non-deterministic routing behavior","messagePattern":"Non-deterministic routing danger: Attempting to create page: \"(.+?)\", but page \"(.+?)\" already exists\nThis could lead to non-deterministic routing behavior","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/gatsby/src/redux/actions/public.js","lineNumber":461,"sourceCode":"  // If the path doesn't have an initial forward slash, add it.\n  if (internalPage.path[0] !== `/`) {\n    internalPage.path = `/${internalPage.path}`\n  }\n\n  const oldPage: Page = store.getState().pages.get(internalPage.path)\n  const contextModified =\n    !!oldPage && !_.isEqual(oldPage.context, internalPage.context)\n  const componentModified =\n    !!oldPage && !_.isEqual(oldPage.component, internalPage.component)\n  const slicesModified =\n    !!oldPage && !_.isEqual(oldPage.slices, internalPage.slices)\n\n  const alternateSlashPath = page.path.endsWith(`/`)\n    ? page.path.slice(0, -1)\n    : page.path + `/`\n\n  if (store.getState().pages.has(alternateSlashPath)) {\n    report.warn(\n      chalk.bold.yellow(`Non-deterministic routing danger: `) +\n        `Attempting to create page: \"${page.path}\", but page \"${alternateSlashPath}\" already exists\\n` +\n        chalk.bold.yellow(\n          `This could lead to non-deterministic routing behavior`\n        )\n    )\n  }\n\n  // just so it's easier to c&p from createPage action creator for now - ideally it's DRYed\n  const { updatedAt, ...node } = internalPage\n  node.children = []\n  node.internal = {\n    type: `SitePage`,\n    contentDigest: createContentDigest(node),\n  }\n  node.id = `SitePage ${internalPage.path}`\n  const oldNode = getNode(node.id)\n","sourceCodeStart":443,"sourceCodeEnd":479,"githubUrl":"https://github.com/gatsbyjs/gatsby/blob/e85d62f1779e353eaac1753211629a26d123e26c/packages/gatsby/src/redux/actions/public.js#L443-L479","documentation":"In createPage (public actions), a new page's path collides with an existing page differing only by trailing slash (e.g. /about vs /about/). Because both would normalize to overlapping routes, this creates non-deterministic routing — which page wins depends on creation order — so Gatsby warns instead of silently overwriting.","triggerScenarios":"Thrown at packages/gatsby/src/redux/actions/public.js:461 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Normalize paths before createPage: strip or consistently add the trailing slash (use `path === `/` ? ... : trim)` or the slash helper)","Find the two createPage calls producing the duplicate and remove/merge one","Ensure source data (CMS slugs) doesn't mix trailing-slash variants"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"e85d62f1779e353eaac1753211629a26d123e26c","analyzedAt":"2026-08-26T17:50:09.662Z","contentChangedAt":"2026-08-26T17:50:09.662Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}