I was getting the error
Uncaught Error: Module name "underscore" has not been loaded yet for context: _. Use require([])
Solved it adding the shim values in the require js config:
require.config({
paths:{
jquery:'jquery/jquery-min',
underscore:'underscore/underscore-min',
backbone:'backbone/backbone-min'
},
// here
shim: {
underscore: {
exports: '_'
},
backbone: {
deps: ["underscore", "jquery"],
exports: "Backbone"
},
waitSeconds: 15
}
});
Source: http://stackoverflow.com/questions/16774214/trouble-combining-require-js-and-backbone-js-underscore-js
Uncaught Error: Module name "underscore" has not been loaded yet for context: _. Use require([])
Solved it adding the shim values in the require js config:
require.config({
paths:{
jquery:'jquery/jquery-min',
underscore:'underscore/underscore-min',
backbone:'backbone/backbone-min'
},
// here
shim: {
underscore: {
exports: '_'
},
backbone: {
deps: ["underscore", "jquery"],
exports: "Backbone"
},
waitSeconds: 15
}
});
Source: http://stackoverflow.com/questions/16774214/trouble-combining-require-js-and-backbone-js-underscore-js
No comments:
Post a Comment