AnsweredAssumed Answered

load custom modules in JSAPI 4.3

Question asked by DemersM on Mar 23, 2017
Latest reply on Mar 24, 2017 by thejus.kambi



I am new to Dojo and ArcGIS JSAPI. I am using version 4.3 and I would like to load a custom module stored in a .js file in a subdirectory.


I was trying to do just as this example: , but it does not work. Dojo is trying to load my custom module from instead of using location.pathname.replace(/\/[^/]+$/, "") + "/scripts"


<script src=""></script>

    var dojoConfig = {
        paths: { scripts: location.pathname.replace(/\/[^/]+$/, "") + "/scripts" }
    require(["scripts/MspTiledMapServiceLayer"], function(MspTiledMapServiceLayer) {

        new MspTiledMapServiceLayer();




This returns a 404 error at


What am I doing wrong? Thanks a lot for your help.