sveltejs/kit · error

${current_node.component} references missing segment "${pare

Error message

${current_node.component} references missing segment "${parent_id}"

What it means

Route-tree integrity error during manifest creation: while walking a route up to its root layout chain, a parent layout referenced a parameter segment (its parent_id) that no longer exists in the route's segment list — typically caused by mixing parameterized and non-parameterized directories at the same level, so a layout ends up attached to a segment name that is not part of this route.

Source

Thrown at packages/kit/src/core/sync/create_manifest_data/index.js:475

					);
				}

				if (current_route.layout) {
					/** @type {import('types').PageNode[]} */ (current_route.layout.child_pages).push(
						route.leaf
					);
					current_node.parent = current_node = current_route.layout;
					parent_id = current_node.parent_id;
				} else {
					parent_id = undefined;
				}
			}

			current_route = current_route.parent;
		}

		if (parent_id !== undefined) {
			throw new Error(`${current_node.component} references missing segment "${parent_id}"`);
		}
	}

	// remove route objects with no route file
	routes = routes.filter((route) => route.endpoint || route.leaf || route.layout || route.error);

	// add parents to error nodes so that we can compute which page options apply to them
	for (const route of routes) {
		if (!route.error) continue;

		/** @type {import('types').RouteData | null} */
		let current_route = route;
		while (current_route) {
			if (current_route.layout) {
				route.error.parent = current_route.layout;
				break;
			}
			current_route = current_route.parent;

View on GitHub (pinned to 03f1687fe6)

Solutions

  1. Restructure the routes so layout directories and their parameterized children are consistent (e.g. avoid [lang]/layout.svelte alongside a non-parameterized sibling route)
  2. Rename the mismatched segment or move the +layout file to a directory that matches the route's segments
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/kit/src/core/sync/create_manifest_data/index.js:475 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sveltejs/kit@03f1687fe6 (2026-09-02). Data as JSON: /api/errors/0ce585175bbe6f6a. Report an issue: GitHub.