Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Next.js and React

TypeScript says a JSX element type has no construct or call signatures

ErrorJSX element type 'X' does not have any construct or call signatures

Short answer

TypeScript accepts a capitalised JSX tag only when the value is a function component or a class component. This error means the value in the tag is something else: an object, a module namespace, a string or a union containing one. Check what the identifier actually holds, and type dynamic tag names as intrinsic element names.

  • Applies to TypeScript 5.x, React 19, Next.js 15
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Hover the identifier in your editor, or ask the compiler for its type. If the type is not a function or a class, that is the cause.

    npx tsc --noEmit
    # then inspect the identifier named in the first error line
  2. 2Match what you see, then jump to its fix

    1. 1The error names an import that is not a component: import * as, a JSON file, or an object holding several components.The tag is an object or module namespace, not a componentFix
    2. 2const Tag = props.as ?? 'div' then <Tag>, and Tag is typed string.A tag name stored in a variable typed as stringFix
    3. 3'Promise<Element>' is not a valid JSX element, on a Server Component declared async.An async component with an older TypeScript or @types/reactFix

What does the error look like?

  • JSX element type 'X' does not have any construct or call signatures
  • 'Promise<Element>' is not a valid JSX element

Cause 1 of 3

The tag is an object or module namespace, not a component

1Check

TypeScript first tries to resolve a value-based tag as a function component, then as a class component. If both fail it reports the error.

grep -rn "import \* as" src app components

2Fix

Import the actual component, with the right named or default import, instead of the namespace.

// wrong: Icons is a module namespace
import * as Icons from './icons'
const A = <Icons />

// right
import { HomeIcon } from './icons'
const B = <HomeIcon />

3Verify

Run the type check; the error is gone.

npx tsc --noEmit

Confirmed by typescriptlang.org

Did this fix it?

Cause 2 of 3

A tag name stored in a variable typed as string

1Check

Lowercase tags are intrinsic elements and are checked against JSX.IntrinsicElements. A plain string is neither that nor a function or class.

grep -rn "as?:\|tag:" src app components

2Fix

Type the prop as a key of JSX.IntrinsicElements, or as a component type when it may be a component.

type Props = { as?: keyof React.JSX.IntrinsicElements; children: React.ReactNode }

export function Box({ as: Tag = 'div', children }: Props) {
  return <Tag>{children}</Tag>
}

3Verify

Type check the file; <Box as="section"> works and <Box as="nope"> is an error.

npx tsc --noEmit

Confirmed by typescriptlang.org

Did this fix it?

Cause 3 of 3

An async component with an older TypeScript or @types/react

1Check

Before TypeScript 5.1 a tag was checked by comparing what the component returns with JSX.Element, which rejects a Promise. Next.js asks for TypeScript 5.1.3 or higher and @types/react 18.2.8 or higher.

npm ls typescript @types/react

2Fix

Upgrade both packages. No change to the component is needed.

npm install -D typescript@latest @types/react@latest

3Verify

Type check again.

npx tsc --noEmit

Confirmed by nextjs.org

Did this fix it?

How do I stop it coming back?

  • Prefer named exports for components, so a wrong import is a compile error at the import line.
  • Type 'as' style props with keyof JSX.IntrinsicElements or a component type, never string.
  • Keep typescript and @types/react current in the same pull request.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Web apps

TypeScript rejects a useRef ref passed to an input element

Type 'MutableRefObject<HTMLInputElement | undefined>' is not assignable to type 'LegacyRef<HTMLInputElement> | undefined'

The ref prop on a DOM element expects an object whose current value is the element or null.

2 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.