twilio-client package isn't working with next.js
Hi, I'm trying to build an app that involves app to app calling using the Twilio API. My project is built using Next.js, and the
twilio-client package isn't running properly.
Whenever I import the package, I get one of two errors:
TypeError: Cannot redefine property: instance
ReferenceError: window is not defined
To reproduce this issue,
- Create a new Next.js application using
- Install twilio-client using
npm install twilio-client --save
- Create a page and import
twilio-client, using either the CommonJS or ES6 syntax.
- Visit the page.
Does anyone have any experience with this? Can somebody help me out?
- 42 All Categories
- 184 Product Discussions
- 9 Community - Announcements
- 2 Changelog
- 4 Forum UI Updates
- 5 Welcome Guide
- 4 Community - Events
- 1 External Community Events
- 2 Twilio Relay Developer Conference 2021 Mega Thread
- 1 TwilioQuest Contest!
- 20 Inspiration
- 4 Community - Other Discussions
- Community- Twilio Startups