{"record":{"id":"2c5e7a930cabacb4","repo":"vercel/next.js","slug":"your-page-bold-app-normalizedpagepath-did","errorCode":null,"errorMessage":"Your page ${bold(`app/${normalizedPagePath}`)} did not have a root layout. We created ${bold(`app${rootLayoutPath.replace(appDir, '')}`)} for you.","messagePattern":"Your page (.+?)`\\)\\} did not have a root layout\\. We created (.+?)`\\)\\} for you\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/next/src/lib/verify-root-layout.ts","lineNumber":129,"sourceCode":"      availableDir = ''\n    }\n\n    if (typeof availableDir === 'string') {\n      const tsConfigFileName = tsconfigPath || 'tsconfig.json'\n      const resolvedTsConfigPath = path.join(dir, tsConfigFileName)\n      const hasTsConfig = await fs.access(resolvedTsConfigPath).then(\n        () => true,\n        () => false\n      )\n\n      rootLayoutPath = path.join(\n        appDir,\n        availableDir,\n        `layout.${hasTsConfig ? 'tsx' : 'js'}`\n      )\n      await fs.writeFile(rootLayoutPath, getRootLayout(hasTsConfig))\n\n      Log.warn(\n        `Your page ${bold(\n          `app/${normalizedPagePath}`\n        )} did not have a root layout. We created ${bold(\n          `app${rootLayoutPath.replace(appDir, '')}`\n        )} for you.`\n      )\n\n      // Created root layout\n      return [true, rootLayoutPath]\n    }\n  } catch (e) {\n    console.error(e)\n  }\n\n  // Didn't create root layout\n  return [false, rootLayoutPath]\n}\n","sourceCodeStart":111,"sourceCodeEnd":147,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/lib/verify-root-layout.ts#L111-L147","documentation":"verifyRootLayout detects an app-router page rendered without a root layout, writes a minimal layout.(tsx|js) into the app directory automatically, and warns that it did so — a dev-time convenience so rendering can proceed rather than failing on the missing layout.","triggerScenarios":"Thrown at packages/next/src/lib/verify-root-layout.ts:129 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Keep the generated root layout file, or create app/layout.tsx yourself exporting a RootLayout component."],"exampleFix":null,"handlingStrategy":"fallback","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-14T05:17:10.506Z"}