We recently upgraded our application from CRA to Vite and are running into issues with this library (and the agora-rtc-sdk-ng library) when trying to preview a build. I both scenarios, we get the following console error when trying to preview the build:
it is not a constructor or e is not a constructor with the stack trace originating from the Agora library import. We then tried dynamically importing the library, which allowed the page to load, but then ran into the issue again when we go to initialize the library.
Prior to Vite, we had the library working fine with CRA. And, we've tried configuring Vite with ESNext and ES2015 build targets using terser but none of those options have worked. We also tried to getting the Quick Demo React to work (available here: https://github.com/AgoraIO/agora-rtc-web/tree/main/projects/quick-demo-react) but that runs into an Agora-RTE-Extension--1.2.4.tgz not found 404 error when running pnpm i.
We recently upgraded our application from CRA to Vite and are running into issues with this library (and the
agora-rtc-sdk-ng
library) when trying to preview a build. I both scenarios, we get the following console error when trying to preview the build:it is not a constructor
ore is not a constructor
with the stack trace originating from the Agora library import. We then tried dynamically importing the library, which allowed the page to load, but then ran into the issue again when we go to initialize the library.Prior to Vite, we had the library working fine with CRA. And, we've tried configuring Vite with
ESNext
andES2015
build targets usingterser
but none of those options have worked. We also tried to getting the Quick Demo React to work (available here: https://github.com/AgoraIO/agora-rtc-web/tree/main/projects/quick-demo-react) but that runs into anAgora-RTE-Extension--1.2.4.tgz not found 404
error when runningpnpm i
.Any ideas on how to get the Vite build working?