Give me a solution for this ERROR

Give me a solution for this ERROR

I am having this error while migration old version to new version.

Uncaught Error: cannot call methods on button prior to initialization; attempted to call method 'widget'

Tell me how to solve this ERROR.