I faced a weird situation here..
.
Below code is working:
// this code working perfectly
$.getScript( "https://wchat.freshchat.com/js/widget.js" ).done(( script, textStatus )=>{
// run something
});
.
.
But if I put the whole code inside setTimeout it will give error in browser console
// this will give error in browser console
setTimeout(()=>{
$.getScript( "https://wchat.freshchat.com/js/widget.js" ).done(( script, textStatus )=>{
// run something
});
}, 4000);
and it will give error in browser console:
What is the problem?

I had the same issue when update Bootstrap v4.0 to v4.3.1
To fix it you need to use jQuery without
slimpostfix. (Usejquery-3.3.1.min.jsinstead ofjquery-3.3.1.slim.min.js)