#16405 closed defect (invalid)
Micro event API not working
Reported by: | adros | Owned by: | Rawld Gill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.9 |
Component: | Loader | Version: | 1.8.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Micro event api seems to be not working:
- cross browser
- as documented
I have a simple test case:
define([ "require" ], function(_require) { require.on("error", handleAmdError); require([ "foo/bar" ], function() { console.log("foo/bar loaded"); }); function handleAmdError(error) { console.log(error); } });
When I run it in Chrome, two errors are handled. First with message "scriptError", this on is not mentioned in docs, i would expect "xhrFailed" and second one with message "timeout". Same behaviour is in Firefox.
But when I run the test in IE(9), no event occurs.
Attachments (1)
Change History (4)
comment:1 Changed 8 years ago by
Milestone: | tbd → 1.9 |
---|---|
Resolution: | → invalid |
Status: | new → closed |
comment:2 Changed 8 years ago by
I do not agree with you. 'config-dojo-loader-catches' would turn on catching of errors in factory. But this code will not rise any error:
require([ "foo/bar" ], function() { console.log("foo/bar loaded"); });
Changed 7 years ago by
Attachment: | bug16405.js added |
---|
comment:3 Changed 7 years ago by
I still consider this issue as valid (but I do not have rights to change state).
I have attached a DOH test (bug16405.js), which works in latest Chrome and also IE10, but fails in IE9.
Note: See
TracTickets for help on using
tickets.
The root problem you are experiencing is that the loader is not
catch
ing an error.
At one point in its history, the loader caught and reported all errors. However, many thought it better to let the error propagate to the debugger. As a middle ground, it was decided to make the behavior configurable.
In order to get the effect you want, set the has feature
"config-dojo-loader-catches"
truthy; for example: