muxinc / media-chrome

Custom elements (web components) for making audio and video player controls that look great in your website or app.
https://media-chrome.org
MIT License
1.77k stars 71 forks source link

React components throw error when used in NextJS 14+ #778

Closed deckchairlabs closed 11 months ago

deckchairlabs commented 11 months ago

The following error occurs during development, and causes 500 errors when deployed to production. I believe the generated React component wrappers just need a use client directive

⨯ ../node_modules/.pnpm/media-chrome@1.6.0/node_modules/media-chrome/dist/media-chrome-button.js (80:43) @ HTMLElement
⨯ Class extends value undefined is not a constructor or null
This might be caused by a React Class Component being rendered in a Server Component, React Class Components only works in Client Components. Read more: https://nextjs.org/docs/messages/class-component-in-server-component
deckchairlabs commented 11 months ago

This seems to no longer be the case with latest NextJS 14.0.4