userback / widget-js

MIT License
4 stars 3 forks source link

window.Userback.init is not a function #72

Closed win-ly closed 1 month ago

win-ly commented 1 month ago

Suddenly I found that the project's Userback didn't work and threw an error. I checked my code and didn't make any changes recently. So I checked the official documentation again and used the official examples to test and found that the same error was thrown.

image

After investigation, we found that the init method should be executed before the userback script is loaded. So how can we avoid this?

skyflyer commented 1 month ago

I just want to add this happens with plain old HTML/JS as well. The window.Userback object is not initialized when script element's onload handler is fired.

lee-userback commented 1 month ago

This is due to the whole widget code was made async. It should be fixed now.