Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#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:


Micro event api seems to be not working:

  1. cross browser
  2. as documented

I have a simple test case:

], function(_require) {

	require.on("error", handleAmdError);

	], function() {
		console.log("foo/bar loaded");

	function handleAmdError(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)

bug16405.js (1.2 KB) - added by adros 8 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 Changed 9 years ago by Rawld Gill

Milestone: tbd1.9
Resolution: invalid
Status: newclosed

The root problem you are experiencing is that the loader is not catching 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:

    var require = {
<script src="dojo/dojo.js"></script>

comment:2 Changed 9 years ago by adros

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:

], function() {
	console.log("foo/bar loaded");

Changed 8 years ago by adros

Attachment: bug16405.js added

comment:3 Changed 8 years ago by adros

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.