skip to Main Content

Minor but annoying problem, I’m implementing Scalderone in my chat app and Typescript always gives me this error:

"Property ‘Scaledrone’ does not exist on type ‘Window & typeof globalThis’.ts(2339)"

 drone = new window.Scaledrone('XXXXXXXXXXXXXXXX', {
        data: meRef.current,
    });

"Scalderone" part is underlined in red

2

Answers


  1. You can declare Scaledrone as property of window

    declare global {
      interface Window {
        Scaledrone:(key:string,props:unkown)=>void;
      }
    }
    let Scaledrone = window.Scaledrone;
    

    Also remember you need to create a index.d.ts and add the above code there, if it is not there

    Login or Signup to reply.
  2. Make sure oo include the Scaledrone library in the head section of your HTML file.

    <script src='https://cdn.scaledrone.com/scaledrone.min.js'></script>
    

    You can read more about it from Scaledrone’s documentation.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search