angularshim

WARNING Crisp found shims of native JavaScript methods


We have an error in our application coming from Crisp (Live chat) saying this:

[WARNING] Crisp found shims of native JavaScript methods. This can alter the chatbox behavior and break things. Make sure not to override listed functions to ensure your chatbox works as expected. You may be looking for other JavaScript libraries in use on this page.

You can disable this warning by adding: $crisp.push(["safe", true]) to your page JavaScript.

Methods to check: Object.prototype.toString
{
    arguments: [
        [WARNING] Crisp found shims of native JavaScript methods. This can alter the 
        chatbox behavior and break things. Make sure not to override listed functions 
        to ensure your chatbox works as expected. You may be looking for other 
        JavaScript libraries in use on this page.

        You can disable this warning by adding: $crisp.push(["safe", true]) to your 
        page JavaScript.

        Methods to check:
        [
            Object.prototype.toString
         ]
    ], 
    logger: console
}

Crisp is used in a project developed with Angular (version 12).

Does anyone face this problem? Is there a workaround solution?

By the way, we do not want to disable the warning.

Thank you in advance and have a nice day/evening!


Solution

  • Apparently your project's code or some dependency is using native toString() method.

    In my case it yelled at us when we used Array(). We also don't want to remove any warning coming from Crisp.

    [WARNING] Crisp found shims of native JavaScript methods. This can alter the chatbox behavior and break things. Make sure not to override listed functions to ensure your chatbox works as expected. You may be looking for other JavaScript libraries in use on this page.
    
    You can disable this warning by adding: $crisp.push(["safe", true]) to your page JavaScript.
    
    Methods to check: Array(1)
    

    If the said method is found in your codebase, simply change it to something else. But if you really need it, there is nothing you can do about it. As long as the method does not interfere with Crisp functions I think it's fine to just ignore the warning