{"record":{"id":"7a99c443f034e020","repo":"vercel/next.js","slug":"next-devtools-simulated-error","errorCode":null,"errorMessage":"NEXT_DEVTOOLS_SIMULATED_ERROR","messagePattern":"NEXT_DEVTOOLS_SIMULATED_ERROR","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/next-devtools/userspace/app/segment-explorer-node.tsx","lineNumber":67,"sourceCode":"\n  // Use `useLayoutEffect` to ensure the state is updated during suspense.\n  // `useEffect` won't work as the state is preserved during suspense.\n  useLayoutEffect(() => {\n    dispatcher.segmentExplorerNodeAdd(nodeState)\n    return () => {\n      dispatcher.segmentExplorerNodeRemove(nodeState)\n    }\n  }, [nodeState])\n\n  return null\n}\n\nfunction NotFoundSegmentNode(): React.ReactNode {\n  notFound()\n}\n\nfunction ErrorSegmentNode(): React.ReactNode {\n  throw new Error(SEGMENT_EXPLORER_SIMULATED_ERROR_MESSAGE)\n}\n\nconst forever = new Promise(() => {})\nfunction LoadingSegmentNode(): React.ReactNode {\n  use(forever)\n  return null\n}\n\nexport function SegmentViewStateNode({ page }: { page: string }) {\n  const { tree } = useContext(GlobalLayoutRouterContext)\n  useLayoutEffect(() => {\n    dispatcher.segmentExplorerUpdateRouteState(page, tree)\n    return () => {\n      dispatcher.segmentExplorerUpdateRouteState('', null)\n    }\n  }, [page, tree])\n  return null\n}","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/next-devtools/userspace/app/segment-explorer-node.tsx#L49-L85","documentation":"This is a deliberate sentinel error, not a bug: the Next.js DevTools segment explorer's ErrorSegmentNode component always throws SEGMENT_EXPLORER_SIMULATED_ERROR_MESSAGE so developers can preview how the dev overlay and segment tree display thrown errors.","triggerScenarios":"The devtools segment explorer throws its simulated error.","commonSituations":"A deliberately thrown error used to test the dev overlay in development tooling.","solutions":["This is a simulated dev-tools test error; ignore it or disable the devtools simulation."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}