{"record":{"id":"1d6daea9e3b34db0","repo":"facebook/react","slug":"130","errorCode":"130","errorMessage":"Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: ${type == null ? type : typeof type}.${info}","messagePattern":"Element type is invalid: expected a string \\(for built-in components\\) or a class/function \\(for composite components\\) but got: (.+?)\\.(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-server/src/ReactFizzServer.js","lineNumber":3183,"sourceCode":"  }\n\n  let info = '';\n  if (__DEV__) {\n    if (\n      type === undefined ||\n      (typeof type === 'object' &&\n        // $FlowFixMe[invalid-compare]\n        type !== null &&\n        Object.keys(type).length === 0)\n    ) {\n      info +=\n        ' You likely forgot to export your component from the file ' +\n        \"it's defined in, or you might have mixed up default and \" +\n        'named imports.';\n    }\n  }\n\n  throw new Error(\n    'Element type is invalid: expected a string (for built-in ' +\n      'components) or a class/function (for composite components) ' +\n      `but got: ${type == null ? type : typeof type}.${info}`,\n  );\n}\n\nfunction resumeNode(\n  request: Request,\n  task: ReplayTask,\n  segmentId: number,\n  node: ReactNodeList,\n  childIndex: number,\n): void {\n  const prevReplay = task.replay;\n  const blockedBoundary = task.blockedBoundary;\n  const resumedSegment = createPendingSegment(\n    request,\n    0,","sourceCodeStart":3165,"sourceCodeEnd":3201,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-server/src/ReactFizzServer.js#L3165-L3201","documentation":"Fizz hit an element whose type is neither a string (host component), a function/class (composite component), nor a symbol-tagged object (memo/forwardRef/lazy/context). Most often the type is undefined because of an import mistake; the info suffix in the message calls out the default/named import mixup case. Error code 130.","triggerScenarios":"Rendering <Foo/> where Foo is undefined: default vs named import mismatch, missing export, a circular import evaluating to undefined at SSR time, or passing an arbitrary object/number as the element type.","commonSituations":"Refactors that rename exports; barrel-file import cycles; CJS/ESM interop differences between Node and the bundler; SSR rendering a library entry that conditionally exports.","solutions":["Check the import style against the module's actual export (default vs named)","Break circular imports by moving the shared component into its own module","Assert component maps are valid element types in dev before SSR (react-is isValidElementType)"],"exampleFix":"// before\nimport Button from './Button'; // module exports named { Button }\nreturn <Button />; // Button is undefined -> throws\n\n// after\nimport {Button} from './Button';\nreturn <Button />;","handlingStrategy":"validation","validationCode":"import {isValidElementType} from 'react-is';\n\nfor (const [name, Component] of Object.entries(routes)) {\n  if (!isValidElementType(Component)) {\n    throw new Error(`Route component '${name}' did not import correctly`);\n  }\n}","typeGuard":"import {isValidElementType} from 'react-is';\n\nif (isValidElementType(Component)) {\n  element = <Component />; // narrowed to a renderable type\n}","tryCatchPattern":null,"preventionTips":["Prefer named exports and imports for components","Break import cycles around shared components","Smoke-validate component maps with react-is in dev before rendering on the server"],"tags":["invalid-element-type","imports","undefined","ssr"],"backgroundTag":"invalid-element-type","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}