Fixes widget check to be compatible with requireJS.