I am having some problems getting the RequireJS text plugin to work. This is possibly a path related issue (or something similarly obvious) but I can't solve it because neither the chrome console (with xhr turned on) nor firebug is giving me any info other than
Uncaught Error: Load timeout for modules: text http://requirejs.org/docs/errors.html#timeout
I am quite sure that the paths are OK but I cant find any other explanation. Does somebody have an idea how to debug this?
I am using node.js and express on the server side and backbone and jQuery on the client end. All of these get loaded correctly with RequireJS.
I'm guessing it's a path issue. I have the same setup (node/express and backbone) and it seems to be working for me. Here is my main.js file:
require.config({
paths: {
jquery: 'libs/jquery-1.7.1.min',
underscore: 'libs/underscore',
backbone: 'libs/backbone',
text: 'libs/text',
templates: '../views',
persist: 'libs/persist/persist'
}
});
require([
'app'
], function(App){
App.initialize();
});
and here is how I call the plugin from within a module:
define([
'jquery',
'underscore',
'backbone',
'collections/sub_elements',
'collections/elements',
'views/element',
'text!../../../views/partials/_elements.html'
], function($, _, Backbone, sub_elementsCollection, collection, view, template){
var elementsView = Backbone.View.extend({
// ... //
});
return elementsView;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With