I had same problem, but my widget was public. And i was using it in React App. I had to move script into index.html file to make it work, instead of placing it in Component or a Page. Hope it helps someone.