AgoraIO-Extensions/agora-rtc-react

AgoraRTCReactException: Super constructor null of Sl is not a constructor.

Closed this issue · 8 comments

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.

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.

At Next.js v14.1.3 which version of agora-rtc-react is applicable?

@abu-noman30 you can use agora-rtc-react@2.3.0

@guoxianzhe with Next.js v14.1.3 rtc-react v2.1.0 / v2.2.0/ v2.3.0 all producing same error.

@abu-noman30 I saw you mentioned that nextjs@14.1.3 works fine in deployment, but not in production. If upgrading to nextjs@14.2.x resolves the issue, I can't think of how reactsdk could help in this situation; it's quite strange. If possible, could you provide a minimal reproduce environment for me?

@abu-noman30 Can you provide a repro project for this?

What version should I use for nextjs 13?

@digz6666 I tested nextjs@13.5.7 and agora-rtc-react@latest, everything is ok.

@abu-noman30 I think this is nextjs bug and i tested nextjs@14.2.x has been fixed this issue.