Error: multipleDefine from Dojo & jQuery-UI conflict
Asked Answered
G

1

8

I am trying to create an editable SlickGrid (which uses jquery-ui) and also use Dojo.

When my page contains
<script src="../../bower_components/dojo/dojo.js"></script>
<script src="../../bower_components/SlickGrid/lib/jquery-ui-1.11.3.js"></script>
<script src="../../mlads/fillDemo/FillDemo.js"></script>
the console shows

Error: multipleDefine
return mix(new Error(error), {src:"dojoLoader", info:info});  dojo.js (line 106)
src: dojoLoader   dojo.js (line 1896)
info: Object { pid="dijit",  mid="dijit/_WidgetsInTemplateMixin",  pack={...},  more...}

If I comment out the jquery-ui line, the error goes away.
FillDemo.js is my source code, which starts with

require(
[    "dojo/_base/declare",
     "dijit/_WidgetBase", 
     "dijit/_TemplatedMixin",
     "dijit/_WidgetsInTemplateMixin",
     "dijit/registry",
     "dijit/form/Button", 
     "dijit/form/DropDownButton",
Galangal answered 8/5, 2016 at 23:50 Comment(0)
F
11

It looks like this is an error with the order in which jQuery UI is loaded vs when the dojo loader is intialized.

See the discussion here for more context: https://geonet.esri.com/message/448542#comment-448449

The solution is to make sure dojo loader is called after jQuery UI and jQuery have loaded. For this, you can move the loading of dojo to the bottom of the HTML page, and leave jQuery and jQueryUI in the header.

Forespeak answered 10/5, 2016 at 20:40 Comment(1)
Moving the jQuery UI to the top of the list of scripts worked for me!Keciakeck

© 2022 - 2024 — McMap. All rights reserved.