Error when importing twilio-chat - Module not found: Can't resolve 'babel-runtime/core-js/array/from' #16231
-
Hi, I'm moving my app from create-react-app to Nextjs and I'm running into a weird bug when installing twilio-chat.
I created a sandbox with a basic nextjs set up to reproduce the error. I tried to install @babel/runtime and other packages from @babel but nothing works. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think the issue is how the
{
"name": "twilio-chat",
"version": "4.0.0",
"description": "Twilio Chat service client library",
"main": "lib/index.js",
"browser": "browser/index.js",
"types": "./lib/client.d.ts",
... If you change the import to |
Beta Was this translation helpful? Give feedback.
I think the issue is how the
twilio-chat
library defines what the package entry points are. Next is grabbing thebrowser
entry but that is not working.lib
seems to work though.twilio-chat/package.json
If you change the import to
import { Client as ChatClient } from 'twilio-chat/lib';
it works.