Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RequireJS error callback not used for CoffeeScript not found errors. #39

Open
guybedford opened this issue Dec 6, 2012 · 2 comments
Open

Comments

@guybedford
Copy link
Contributor

If I try to load a CoffeeScript file that doesn't exist:

  require(['cs!some/module'], function(m) {
  }, function(err) {
    console.log(err.toString());
  });

then instead of the error callback catching it, it throws the error entirely. Ideally, the same error callback could be triggered.

The error message is:

  Uncaught Error: fromText eval for some/module failed: ReferenceError: Not is not defined 
@jrburke
Copy link
Member

jrburke commented Dec 6, 2012

Right, looks like this plugin is not using the load.onerror functionality. If you want to work up a patch, you can look at the text plugin for inspiration. Specifically:

https://github.com/requirejs/text/blob/master/text.js#L165

shows passing an errback function to text.get (which is called fetchText in this plugin), and then fetchText in this plugin would need to be modified to call the errback function on a failure.

@guybedford
Copy link
Contributor Author

Ok great I will get to this along with the xhr hooks, although it may be another week or so yet before I can get down to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants