How to resolve the issue with the @tawk.to/tawk-messenger-react module lacking TypeScript definitions.
Could not find a declaration file for module '@tawk.to/tawk-messenger-react'. 'c:/develop/eachblock/aquatrack/management-tool-app/node_modules/@tawk.to/tawk-messenger-react/dist/tawk-messenger-react.es.js' implicitly has an 'any' type. Try
npm i –save-dev @types/tawk.to__tawk-messenger-reactif it exists or add a new declaration (.d.ts) file containing
declare module ‘@tawk.to/tawk-messenger-react’;“
After installing the tawk using
npm i @tawk.to/tawk-messenger-react
I then create a new component in the component folder named TawkMessenger, and add this to the component:
`import TawkMessengerReact from “@tawk.to/tawk-messenger-react”;
const TawkMessenger = () => {
return (
<TawkMessengerReact
propertyId="YOUR_PROPERTY_ID"
widgetId="YOUR_WIDGET_ID"
/>
);
};
export default TawkMessenger;`
But I keep getting this error
Could not find a declaration file for module '@tawk.to/tawk-messenger-react'. 'c:/develop/eachblock/aquatrack/management-tool-app/node_modules/@tawk.to/tawk-messenger-react/dist/tawk-messenger-react.es.js' implicitly has an 'any' type. Try
npm i –save-dev @types/tawk.to__tawk-messenger-reactif it exists or add a new declaration (.d.ts) file containing
declare module ‘@tawk.to/tawk-messenger-react’;“
But when I follow the instructions and try to install the npm i --save-dev @types/tawk.to__tawk-messenger-react
It was unable to install.
Caleb benjamin Calebbenjin is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.