Skip to content

fix: migrate react-markdown 8.0.7 to 9.0.3 to resolve React compatibi…#2614

Closed
prassamin wants to merge 1 commit intoGetStream:masterfrom
prassamin:master
Closed

fix: migrate react-markdown 8.0.7 to 9.0.3 to resolve React compatibi…#2614
prassamin wants to merge 1 commit intoGetStream:masterfrom
prassamin:master

Conversation

@prassamin
Copy link

Pull Request: Upgrade react-markdown in stream-chat-react

🎯 Goal

The goal of this change is to upgrade the react-markdown dependency from version v8.0.7 to v9.0.3 in the stream-chat-react package to resolve compatibility issues with modern React versions.

Problem Description

The stream-chat-react package currently uses an outdated version of the react-markdown library (v8.0.7). This version causes compatibility issues with modern React projects, including React 19 and Next.js, resulting in:

  • Build Errors: Issues such as Cannot find namespace "JSX" during builds.
  • Dependency Conflicts: Mismatches with updated React libraries.

Solution

To resolve these issues, this PR updates all instances of react-markdown in stream-chat-react to use version v9.0.3. The update also ensures that:

  1. Functionality Remains Intact: Verified that all features using react-markdown continue to work as expected.
  2. Dependencies Are Aligned: Ensured compatibility with peer libraries and React versions.

Changes Summary

  • Replaced react-markdown@8.0.7 with react-markdown@9.0.3.
  • Updated usage of react-markdown throughout the stream-chat-react codebase.

Submission Details

  • Testing: All usage of react-markdown has been verified to function correctly.
  • Documentation: No changes required, as there is no impact on public-facing APIs.

Thank you for reviewing this pull request!

@MartinCupela
Copy link
Contributor

@prassamin this PR does not test the impacts it introduces. At the moment we do not plan to upgrade react-markdown. See this PR: #2461

Is there something that prevents you from upgrading on your side?

@prassamin
Copy link
Author

@MartinCupela The issue I’m facing occurs specifically during the build process of my Next.js project. It throws errors related to JSX and TypeScript compatibility
Screenshot From 2025-01-23 20-15-49

@prassamin
Copy link
Author

And when I use the npm overrides feature to upgrade react-markdown to version 9.0.3:

"overrides": {
  "react-markdown": "9.0.3"
}

it results in errors during the development phase.

Screenshot From 2025-01-23 23-09-10

@MartinCupela
Copy link
Contributor

@prassamin could you please follow the this recommendation to unblock you?

#2615 (comment)

@prassamin prassamin closed this Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants