Skip to content

JSX namespace is not defined in react 19+ #911

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks done
tshmieldev opened this issue May 1, 2025 · 2 comments
Closed
4 tasks done

JSX namespace is not defined in react 19+ #911

tshmieldev opened this issue May 1, 2025 · 2 comments
Labels
🤷 no/invalid This cannot be acted upon 👎 phase/no Post cannot or will not be acted on

Comments

@tshmieldev
Copy link

Initial checklist

Affected package

main package

Steps to reproduce

Make a project in NextJS (using typescript, next15)
Use React-Markdown in a client component
Run build task

Actual behavior

I am using react-markdown in Next 15 (React 19)
Doing npm run build causes this problem

./node_modules/react-markdown/lib/complex-types.ts:25:21
Type error: Cannot find namespace 'JSX'.

  23 |
  24 | export type NormalComponents = {
> 25 |   [TagName in keyof JSX.IntrinsicElements]:
     |                     ^
  26 |     | keyof JSX.IntrinsicElements
  27 |     | C
``

After researching this topic, I found the fix: Import React and replace JSX with React.JSX

I would happily make a PR with this change if you allow it

Thanks
Wojtek

### Expected behavior

Not crash, allow the build to finish (that's what happens after my fix)

### Runtime

node@23

### Package manager

npm@10.8

### Operating system

macOS Sequoia 15

### Build and bundle tools

Next.js
@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels May 1, 2025
@remcohaszing
Copy link
Member

This issue is outdated. Update react-markdown.

@remcohaszing remcohaszing closed this as not planned Won't fix, can't repro, duplicate, stale May 1, 2025

This comment has been minimized.

@remcohaszing remcohaszing added 🤷 no/invalid This cannot be acted upon 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels May 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤷 no/invalid This cannot be acted upon 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants