RequireJS Error: Mismatched Anonymous Define() Module

  • Updated

Templates with scripts that leverage RequireJS code and were working prior to upgrading to 9.0 now show an error in the console of MISMATCHED ANONYMOUS DEFINE() MODULES when the UXToolbar is enabled. 


Fixes to the product were made to workaround these changes in version 9.1 SP2 CU16. 

Site Updates
Ektron Version 9.10 SP2, Site Update 18 (EkSiteUpdate910184SP2018)

Update 16 (February 5, 2016)

23639 - If you used a JQuery version that did not match the version used in Ektron, there might be compatibility conflicts. (References to Ektron JQuery were renamed to not conflict and ensure compatibility.)

If you run into issues, please upgrade. If you cannot, please continue reading.

 The error message is thrown if a developer defines a module by adding an HTML script tag to a page. Here is an example of this issue: 

<!DOCTYPE html>

<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
        <script src="//"></script>         <script src="//"></script>
        <script src="UX/vendor/requirejs/require.min.js"></script>         <script type="text/javascript" src="foo.js"></script>

function test (doDefine){
    if (doDefine) {
        define([], function () { });
    } else { = function () { };

$(function () {
    if ('undefined' !== typeof (define)) {   
        alert("there is a define");
    else {
        alert("There is no define");

If you insert this code on an aspx page and <script src="UX/vendor/requirejs/require.min.js"> is commented out, you see the following.

This is an error when Require JS does not work with customer JS.

However, if the <script src="UX/vendor/requirejs/require.min.js"> is not commented out, because the code is defining a module, the following error is thrown:

Uncaught error: Mismatched anonymous define()

To fix the problem, you must update your JavaScript define methods within RequireJS, according to following documentation:

For more in-depth description of how to avoid this and other RequireJS errors, see .