Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-63736

Commented out define produces "Mismatched anonymous define() module"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.6
    • Fix Version/s: None
    • Component/s: JavaScript
    • Labels:
    • Affected Branches:
      MOODLE_36_STABLE

      Description

      A minor issue and only happens in developer mode where the minified js is not run.

      The define comment in lib/amd/src/sortable_list.js will cause a mismatch anonymous define() error in the console log if a plugin is using jquery in an old way such as

       

      $PAGE->requires->jquery();
      $PAGE->requires->js(new moodle_url('/admin/tool/someplugin/code.js'));
      

       It seems that even though the define is in a comment the regex that finds the defines doesn't take comments into account.

      I'm not sure that anything needs to be done here. Hopefully any developers that hit this problem will find this issue.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: