[URGENT] Broken React SDK
# support
m
Trying to run the react sdk results in
Copy code
Uncaught TypeError: _vapi_ai_web__WEBPACK_IMPORTED_MODULE_2__ is not a constructor
Issue was created here https://github.com/VapiAI/client-sdk-react/issues/35 There's a simple reproduction repo
c
Hi Manny, I reproduced this locally. The SDK works perfectly with Vite but fails with
react-scripts
(Create React App). Root Cause: Your project is using
react-scripts
, which has known issues handling modern ESM exports. It incorrectly bundles the SDK import, causing the
TypeError: ... is not a constructor
runtime error. Fix: Since this is a test app, I strongly recommend initializing with Vite instead of CRA. It handles ESM natively and resolves this immediately. Bash
Copy code
npm create vite@latest my-vapi-app -- --template react
Let me know if you hit any issues after switching bundlers. Best, Vikash
2 Views