0

I am trying to run the package @twilio-conversations in react-typescript.

It fails to compile with following error:

./src/components/communications/conversations/ConversationsSetup.tsx
Module not found: Can't resolve '@twilio-conversations' in ...

Declaring the module in definition file: @types/alltypes.d.ts -> [declare module "@twilio-conversations"] does not help.

With JavaScript it works fine.

Can anyone let me know, if they are facing similar issue?

yvesonline
  • 4,609
  • 2
  • 21
  • 32
Deepak CR
  • 21
  • 4
  • I'm just guessing, but did you try adding `"@twilio-conversations"` to your tsconfig.js under `"types"` ? – mtbno Feb 12 '21 at 11:46
  • In file: `tsconfig.json`, I have added: "typeRoots": [ "./node_modules/@types", "./@types" ] And in the file: `@Types/alltypes.d.ts` -> I have added: `declare module "@twilio-conversations"` Note: Other packages like `react-stopwatch`, `react-stepper-horizontal` work with the above approach, but this package: `@twilio-conversations` is not working with same approach – Deepak CR Feb 12 '21 at 12:47

1 Answers1

0

Switching to package with name: @twilio/conversations started working.

Deepak CR
  • 21
  • 4