requirejs:模块名称“下划线”尚未加载上下文

当我刚刚加载我的应用程序时,我总是收到此错误,

Error: Module name "underscore" has not been loaded yet for context: _. Use require([]) http://requirejs.org/docs/errors.html#notloaded ...,h){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.re... require.js (line 8) TypeError: Backbone.Model is undefined var ProjectModel = Backbone.Model.extend({ 

但是当我点击浏览器上的刷新按钮时它们就消失了。

有谁知道为什么? 我该如何解决?

这是我的config / main / entry js文件,

 require.config({ //By default load any module IDs from js/lib baseUrl: 'js', paths: { jquery: 'lib/jquery/jquery-min', underscore: 'lib/underscore/underscore-min', backbone: 'lib/backbone/backbone-min', text: 'lib/text/text' }, shim: { jquery: { exports: '$' }, underscore: { exports: '_' }, backbone: { exports: 'Backbone' } } }); require([ // Load our app module and pass it to our definition function 'app', 'jquery', 'underscore', 'backbone', // Pull in the Collection module. 'collection/contacts' ], function(App){ // The "app" dependency is passed in as "App" App.initialize(); }); 

我错过了什么吗?

在此处输入图像描述

试试这个:

 shim: { jquery: { exports: '$' }, underscore: { deps:["jquery"], exports: '_' }, backbone: { deps:["jquery"], exports: 'Backbone' } }