AgoraIO-Extensions / agora-rtc-react

Agora RTC React SDK
https://agoraio-extensions.github.io/agora-rtc-react/
MIT License
31 stars 11 forks source link

AgoraRTCReactException: Super constructor null of Sl is not a constructor in Production (Next.js v14.1.3 & Agora-RTC-React v2.1.0). #205

Closed abu-noman30 closed 1 month ago

abu-noman30 commented 2 months ago

What kind of problem do you need help?

I'm facing an issue with Agora video calling in my production environment. I'm using Agora-RTC-React v2.1.0 and Next.js v14.1.3 for a video calling feature in my app.

The problem occurs only after deployment to production. In my local development environment, everything works perfectly, and video calls run smoothly. However, after deploying to production, the following error shows up in the browser console:

Screenshot 2024-09-18 030437

Since the createCameraVideoTrack function fails due to this error, it is unable to access or create the camera track, leading to the camera not functioning.

hyrious commented 2 months ago

Simply googling this error message gives me this: https://github.com/webpack/webpack/issues/17711

It seems to be a bug in webpack and was fixed in webpack@5.90.0.

abu-noman30 commented 2 months ago

This error is caused by a version mismatch between Next.js and agora-rtc-react.

Using Next.js v14.2.12 with agora-rtc-react v2.3.0 resolves the issue. The application runs smoothly in both development and production environments.

abu-noman30 commented 2 months ago

Re-Openning....

guoxianzhe commented 2 months ago

duplicate with #206

guoxianzhe commented 1 month ago

done with https://github.com/AgoraIO-Extensions/agora-rtc-react/issues/206#issuecomment-2431648357