Skip to content
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

Build breaks with React 19 and Next.js 15. I had to add JSX to the import line for it to build #882

Closed
rarebdavis opened this issue Jan 17, 2025 · 2 comments
Labels
🤷 no/invalid This cannot be acted upon 👎 phase/no Post cannot or will not be acted on

Comments

@rarebdavis
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-markdown@8.0.7 for the project I'm working on.

It was breaking the build with React 19 and Next.js 15. I had to add JSX to the import statement:
import type {ReactNode, ComponentType, ComponentPropsWithoutRef, JSX} from 'react'

Here is the diff that solved my problem:

diff --git a/node_modules/react-markdown/lib/complex-types.d.ts b/node_modules/react-markdown/lib/complex-types.d.ts
index f67d04a..b62cadf 100644
--- a/node_modules/react-markdown/lib/complex-types.d.ts
+++ b/node_modules/react-markdown/lib/complex-types.d.ts
@@ -1,4 +1,4 @@
-import type {ReactNode, ComponentType, ComponentPropsWithoutRef} from 'react'
+import type {ReactNode, ComponentType, ComponentPropsWithoutRef, JSX} from 'react'
 import type {Position} from 'unist'
 import type {Element} from 'hast'
 export type ReactMarkdownProps = {
diff --git a/node_modules/react-markdown/lib/complex-types.ts b/node_modules/react-markdown/lib/complex-types.ts
index 5319a88..efd64bf 100644
--- a/node_modules/react-markdown/lib/complex-types.ts
+++ b/node_modules/react-markdown/lib/complex-types.ts
@@ -1,4 +1,4 @@
-import type {ReactNode, ComponentType, ComponentPropsWithoutRef} from 'react'
+import type {ReactNode, ComponentType, ComponentPropsWithoutRef, JSX} from 'react'
 import type {Position} from 'unist'
 import type {Element} from 'hast'
 

This issue body was partially generated by patch-package.

@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 Jan 17, 2025
@remcohaszing
Copy link
Member

You’re using an old version of react-markdown that doesn’t support React 19.

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

This comment has been minimized.

@remcohaszing remcohaszing added the 🤷 no/invalid This cannot be acted upon label Jan 17, 2025
@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Jan 17, 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