在 durandal 中添加的新依赖项未在浏览器中加载

New dependencies added in durandal are not loaded in browser

我正在使用 requirejs 将 toastr 加载到我的 durandal 项目中,它给我以下错误:

另外,我不知道为什么它在错误的位置搜索:

"NetworkError: 404 Not Found - http://localhost:8080/CaseManagementSystem/assets/ui/app/toastr.js?bust=1441970183153"
toastr....0183153
Error: Failed to load routed module (viewmodels/cmsPage). Details: Script error for: toastr
http://requirejs.org/docs/errors.html#scripterror


exception = new Error(error);

system....0183153 (line 100)
Error: Failed to load routed module (viewmodels/cmsPage). Details: Script error for: toastr
http://requirejs.org/docs/errors.html#scripterror


exception = new Error(error);

我的配置是:

requirejs.config({
    urlArgs : "bust=" + (new Date()).getTime(),
    /*config:{
        moment:{
            noGlobal:true
        }
    },*/
    paths : {
        'text' : '../lib/require/text',
        'durandal' : '../lib/durandal/js',
        'plugins' : '../lib/durandal/js/plugins',
        'transitions' : '../lib/durandal/js/transitions',
        'knockout' : '../lib/knockout/knockout-3.1.0',
        'knockout.mapping' : '../lib/knockout/knockout.mapping-latest',
        'bootstrap' : '../lib/bootstrap/js/bootstrap',
        'jquery' : '../lib/jquery/jquery-1.9.1',
        'd3' : "../lib/d3/d3",
        'lodash' : '../lib/jointjs/lodash',
        'underscore' : '../lib/jointjs/lodash',
        'backbone' : '../lib/jointjs/backbone',
        'moment' : '../lib/moment/moment.min',
        'q' : '../lib/q/q',
        'watable' : '../lib/watable/js/jquery.watable',
        'bootstrapEdit' : '../lib/bootstrap3-editable/js/bootstrap-editable',
        'sugar' : '../lib/sugar/sugar-1.4.1-custom.min',
        'list': '../lib/list/list',
        'bootstrapDatepicker':'../lib/bootstrap-datepicker/js/bootstrap-datepicker',
        'keycloak':'http://10.50.33.18:9080/auth/js/keycloak',
         toastr: '../lib/toastr/js/toastr'

    },
    shim : {

        'bootstrap' : {
            deps : [ 'jquery' ],
            exports : 'jQuery'
        },
        'knockout.mapping' : {
            deps : [ 'knockout' ]
        },
        'q' : {
            exports : 'Q'
        },
        lodash : {
            exports : '_'
        },
        'breeze' : {
            deps : [ 'jquery', 'q', 'knockout' ]
        },
        backbone : {
            //These script dependencies should be loaded before loading backbone.js.
            deps : [ 'underscore', 'jquery' ],
            //Once loaded, use the global 'Backbone' as the module value.
            exports : 'Backbone'
        },
        toastr: {
            deps: ['jquery'],
            exports: 'toastr'
          }
    }
});

并加载如下模块:

define(
        [ 'plugins/router', 'plugins/http', 'knockout','toastr'],
        function(router, http, ko,toastr) {
本题

Reference

"There are only two hard things in Computer Science: cache invalidation and naming things." -- Phil Karlton (presumedly)

在这种情况下,您似乎经历了其中的第一个。