{"record":{"id":"ebd0fae208c2f1b4","repo":"withastro/astro","slug":"unable-to-render-result-pathname-because-it-con-ebd0fa","errorCode":null,"errorMessage":"Unable to render ${result.pathname} because it contains an undefined Component!\nDid you forget to import the component or is it possible there is a typo?","messagePattern":"Unable to render (.+?) because it contains an undefined Component!\nDid you forget to import the component or is it possible there is a typo\\?","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/astro/src/runtime/server/render/streaming.ts","lineNumber":119,"sourceCode":"\t};\n\n\t// Render function for a dynamic node into a (buffered) destination.\n\tconst renderDynamic =\n\t\t(node: unknown) =>\n\t\t(d: RenderDestination): void | Promise<void> => {\n\t\t\tif (isVNode(node)) {\n\t\t\t\treturn renderJSX(result, node).then((out) => renderChild(d, out));\n\t\t\t}\n\t\t\treturn renderChild(d, node);\n\t\t};\n\n\t// Handle an astro:jsx VNode (JSX in .astro files and MDX/.md pages). Emits\n\t// HTML elements as static, pushes children, and routes components through\n\t// the dynamic path.\n\tconst handleVNode = (vnode: AstroVNode) => {\n\t\tconst type = vnode.type as unknown;\n\t\tif (!type) {\n\t\t\tthrow new Error(\n\t\t\t\t`Unable to render ${result.pathname} because it contains an undefined Component!\\nDid you forget to import the component or is it possible there is a typo?`,\n\t\t\t);\n\t\t}\n\n\t\t// Fragment: process its children.\n\t\tif ((type as any) === Fragment) {\n\t\t\tstack.push(vnode.props?.children);\n\t\t\treturn;\n\t\t}\n\n\t\t// Astro component factory (including `server:defer` islands).\n\t\tif (isAstroComponentFactory(type)) {\n\t\t\tconst props: Record<string, unknown> = {};\n\t\t\tconst slots: Record<string, number | any> = {};\n\t\t\tfor (const [key, value] of Object.entries(vnode.props ?? {})) {\n\t\t\t\tif (\n\t\t\t\t\tkey === 'children' ||\n\t\t\t\t\t(value && typeof value === 'object' && (value as any)['$$slot'])","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/withastro/astro/blob/d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca/packages/astro/src/runtime/server/render/streaming.ts#L101-L137","documentation":"In the streaming JSX renderer (`handleVNode`), a VNode reached processing with a falsy `type`. The VNode `type` is the component function/class/tag; falsy means the component reference is `undefined`. This is the streaming-path equivalent of the jsx.ts undefined-component error and reports the current `result.pathname`.","triggerScenarios":"An undefined variable used as a JSX tag in a streaming page; a dynamic component selector that resolved to undefined; a named import that doesn't exist; a refactoring that left a dangling identifier.","commonSituations":"Missing import; conditional component selection with no fallback; named/default import mismatch; shadowed identifier resolving to undefined.","solutions":["Import the component with the correct name and form.","Verify the identifier is defined and not shadowed at the call site.","Provide a fallback for dynamic component selection so the tag is never undefined."],"exampleFix":"// before\nconst Tag = registry[name]; // undefined when name is unknown\n<Tag />\n\n// after\nconst Tag = registry[name] ?? Fragment;\n<Tag />","handlingStrategy":"type-guard","validationCode":"function assertVNodeComponent(type: unknown, pathname: string): void {\n  if (!type) {\n    throw new Error(`Page ${pathname} contains an undefined component`);\n  }\n}","typeGuard":"const isDefinedComponent = (v: unknown): v is Function | string =>\n  typeof v === 'function' || typeof v === 'string';\n\n// Dynamic tag with safe fallback\nconst Tag = isDefinedComponent(Maybe) ? Maybe : Fragment;","tryCatchPattern":null,"preventionTips":["Import every component statically.","Default dynamic tag lookups to `Fragment` or a placeholder.","Use strict TypeScript to surface undefined identifiers."],"tags":["jsx","undefined-component","streaming","render"],"backgroundTag":null,"analyzedSha":"d081033d5fe8e8a68c4bbbad4af9d2deb9c74bca","analyzedAt":"2026-08-12T13:37:29.035Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}