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

Async load failure #37

Open
ghost opened this issue Sep 23, 2013 · 4 comments
Open

Async load failure #37

ghost opened this issue Sep 23, 2013 · 4 comments

Comments

@ghost
Copy link

ghost commented Sep 23, 2013

In the case that the url fails to load from an async! call, it appears that it blocks the entire page from loading. Shouldn't the onLoad function be called if the module times out?

@millermedeiros
Copy link
Owner

Right now we don't have a timeout for dependencies loaded with the async plugin. I think it should call the error callback.

@ghost
Copy link
Author

ghost commented Sep 23, 2013

Thanks, where do I place the error callback and what should it do? My problem is that my app.js is not executing as a result of the failure.

@millermedeiros
Copy link
Owner

error callbacks only works with async require: http://requirejs.org/docs/api.html#errbacks - so the "best thing" is not to list it as a "hard dependency" (if it might fail).

@ghost
Copy link
Author

ghost commented Sep 23, 2013

Ah, that's the problem then. I want to have the capability of a module depending on a script via async!, but not block the application from loading if that async fails.

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

No branches or pull requests

1 participant