AnsweredAssumed Answered

Dojo build and knockout failing with multipleDefine error once built

Question asked by jay.gregory on Nov 14, 2016
Latest reply on Nov 15, 2016 by odoe

I am using 3.16 of the ArcGIS API, downloaded locally via the bower / grunt instructions located GitHub - Esri/jsapi-resources: A collection of useful resources for developers using the ArcGIS API for JavaScript. .  I have built my application in development using Knockout JS and it works like a charm.  I load the Knockout library in the require section of my main javascript file: 

require(["esri/map", "app/knockout-latest"], function (Map, ko) {.....

My index.html is has the dojoConfig specified as such:

script type="text/javascript">
var dojoConfig = {
baseUrl: '.',
deps: ["app/knockout-latest",'app/main', 'app/date'],
packages: [
parseOnLoad: true
<!--Dojo loader -->
<script src="dojo/dojo.js"></script>


So my app works perfectly in development, but once I use grunt to build the application, it breaks.  The build completes successfully (I use the default build.profile.js from the GitHub repo), but I get a multipleDefine error in dojo.js.  I've tried everything.  


If I don't include it as a dependency in my dojoConfig, I get I.observableArray is not a function in dojo.js, and then a multiple define error.  


I don't know how to fix this, other than to remove it from the build process and AMD load process all together, load it with a separate script tag and don't use it in the require block in my main js file.  Has anyone run into this issue before with the dojo build / loader and knockout?