utag.js conflict with RequireJS

Bronze Contributor
Bronze Contributor
An anonymous define() function in the utag.js from lines 322-323 creates an error with RequireJS that keeps our site from working properly. Is this something we can fix on Tealium's side, or should we go with the solution proposed here? http://requirejs.org/docs/errors.html#mismatch Our developers recommend loading utag.js via the RequireJS API, which is not ideal since it would bring it to the bottom of the page instead of the top of the body where it currently is.
5 REPLIES 5

utag.js conflict with RequireJS

Employee Emeritus
We may need more details here. Do you have a JS Code Extension in Tealium IQ that is creating the "define" function?

utag.js conflict with RequireJS

Bronze Contributor
Bronze Contributor
Not that I know of. It's coming from these lines within the utag.js under the /*global unescape, define, utils */ section: if (typeof define === 'function' && define.amd) { define(function () { return md5; });

utag.js conflict with RequireJS

Bronze Contributor
Bronze Contributor
And here is the error that pops in the console: Error: Mismatched anonymous define() module: function () { "use strict"; return md5; }

utag.js conflict with RequireJS

Employee Emeritus
I found your code block in this library: https://github.com/blueimp/JavaScript-MD5/blob/master/js/md5.js Maybe someone has pasted this library in a JS Extension? (or a pasted in a library that uses this md5 library)?

utag.js conflict with RequireJS

Bronze Contributor
Bronze Contributor
Argh! Found it. This code is included in the Adobe Heartbeat code for video measurement. Thank you!
Public