lahsivjar / react-stomp

React websocket component for STOMP protocol over SockJs
https://www.npmjs.com/package/react-stomp
MIT License
134 stars 41 forks source link

ReactJS: Could not find a declaration file for module 'react-stomp' #221

Open AerialSky93 opened 8 months ago

AerialSky93 commented 8 months ago

I am trying to install react-stomp and getting this error

npm install --save react-stomp

Error:

Could not find a declaration file for module 'react-stomp'.

How Can I fix this error?

rakshitriya commented 8 months ago

@AerialSky93 You can try: npm install --save @types/react-stomp alongwith npm install --save-dev typescript@latest, assuming that this type of error message are thrown by typescript.

If it doesn't help, try updating tsconfig.json:

{
  "compilerOptions": {
    "types": ["@types/react-stomp"],
    // ... other options
  }
}

or

{
  "compilerOptions": {
    "typeRoots": ["node_modules/@types"],
    // ... other options
  }
}