AMD support breaks sites loading widgets.js using a <script> tag



It seems that is trying to define itself as an anonymous AMD module when it finds an AMD-compatible window.define() function.

Doing so is invalid if the script has been loaded using a <script src=></script> tag, which many sites are doing right now.

For instance this causes require.js to throw an exception, and to fail any subsequent attempt to load an AMD module.

I haven’t noticed this before, is this new ?

Here is the offending code snippet in

"function"==typeof define&&define.amd?define(function(){return it})

Here is a reproducing jsfiddle:

The console shows the following error:

Uncaught Error: Mismatched anonymous define() module: function (){return it}


Nice catch. This broke our site and while we saw it was related to the widget.js we’d not yet figured out why.

Thanks for sharing, I think this will break a lot of sites…


We rolled back the deploy that introduced this problem around 1:15pm PST. If you’re still experiencing the problem, please let us know. Apologies for the inconvenience.


Hi Jake,

Thanks for the quick response.

I confirm that the issue is fixed for us.