Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Make sure require errbacks do not cause an error #36

jrburke opened this Issue · 3 comments

2 participants


While almond will not call require errbacks, the usage in module code should not cause errors.

@jrburke jrburke closed this in f7162da

@jrburke What's the motivation behind not calling the error callback when a module fails to load? I currently have some fallback behavior in an error callback that won't work with almond and would be willing to do a pull request with the error callback being applied.


The idea behind almond was that it was just a simpler AMD API provider for some modules that are already all built into a file. It cannot do dynamic loading, so the uses for an error handler did not seem worth increasing the size of almond as it would put a tax on all users of almond.

Feel free to create a fork of almond though and add the behavior. Then you can add it to this list so that others who may want it can find it:


@jrburke I can imitate it easily with

setTimeout(function() {
     try {
         require(['modules-that-doesnt-exist'], function(dep){...}, undefined, true);
     } catch(e) {
         // .... failure behavior....
}, 4);

But it seems like I could easily just change a couple lines in the main function around line 296 to check for, and invoke, an error callback... only a couple extra lines would be necessary. Plus it would keep parody with require.js without actually doing a dynamic script load.

Since I found a work-around, it's not critical, just thought I'd suggest it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.