contentful / live-preview

Preview SDK for both the field tagging connection + live content updates
https://www.contentful.com/developers/docs/tutorials/general/live-preview/
MIT License
60 stars 12 forks source link

Compatibility with Next.js 15 and React 19 #778

Open catchergeese opened 1 month ago

catchergeese commented 1 month ago

Describe the bug @contentful/live-preview throws an error in Next.js 15 (RC) and React 19 (RC).

To Reproduce Steps to reproduce the behavior:

  1. Setup project with Next.js version 15 with React 19
  2. Follow @contentful/live-preview docs for Next.js integration
  3. Run npm run dev to run dev server
  4. See error TypeError: Cannot read properties of undefined (reading 'ReactCurrentDispatcher')

Expected behavior It works.

Context (please complete the following information):

Additional context @contentful/live-preview limits React's version to 18. I built the package locally after removing this restriction and the error is gone (but I didn't test it in-and-out).