Intermittent RequireJS Load Error

redhotvengeance picture redhotvengeance · Jun 9, 2012 · Viewed 8.2k times · Source

I have a rather large Backbone.js project that uses RequireJS. As the project size grew ("size" here referring to the number of separate module files), intermittent errors started cropping up. Most of the time, it's an object error:

Uncaught TypeError: object is not a function

Occasionally, it complains about a module not being loaded.

These errors disappear once the project is run through the r.js optimizer. They only happen when RequireJS is loading the individual modules.

Which brings me down to my question - does RequireJS start having issues with modules loading in time when the number of modules reach a certain number?

Answer

Brendan O'Brien picture Brendan O'Brien · Sep 27, 2012

This Issue seems to be addressed in the forthcoming require.js 2.1 release. See here:

https://github.com/jrburke/requirejs/issues/478