• Error
  • Reported by the lexer and parser

TS17008

JSX element '{0}' has no corresponding closing tag.

A JSX element is opened but never closed. Add its closing tag, or make it self-closing.

What it means

ts-r's parser reached the end of the enclosing JSX (or the file) without finding the closing tag for an element. It's reported at the opening tag.

Example

index.tsx
export const el = <div><span>text</div>;
ts-r-check -p tsconfig.json --pretty false ts-r output
index.tsx(1,20): error TS17008: JSX element 'div' has no corresponding closing tag.
index.tsx(1,36): error TS17002: Expected corresponding JSX closing tag for 'span'.

Recorded by node scripts/verify-examples.mjs with ts-r built from commit 6deaf01. The example uses the default tsconfig: strict, target: es2022, module: esnext, moduleResolution: bundler.

How to fix

  • Add the missing closing tag: <span>text</span>.
  • Use a self-closing tag for elements without children: <br />.