Opened 8 years ago

Closed 8 years ago

#14403 closed defect (duplicate)

Error using dojo-combo-api with IE

Reported by: Akira Sudoh Owned by: Rawld Gill
Priority: high Milestone: 1.7.1
Component: Loader Version: 1.7.0
Keywords: Cc: ddumont
Blocked By: Blocking:

Description (last modified by Adam Peller)

When dojo-combo-api is used with IE, I got “irrationalPath” error in getModuleInfo_() function, and therefore modules could not be loaded.

The stack is like:

getModuleInfo_(mid = "../has", referenceModule = "dojo/_base/array", …)
getModuleInfo(mid = "../has", referenceModule = "dojo/_base/array")
getModule(mid = "../has", referenceModule = "dojo/_base/array")
defineModule(module = "dojo/_base/array", deps = [[object Object], "../has", "./lang"], …)
def([[object Object], "../has", "./lang"], …)
JScript global code
injectUrl(…)
(req.combo.done's callback)(…)
req.combo.done(…)
comboPendingTimer()

It appears that a module structure is expected for the 2nd parameter (referenceModule), though in above case it’s string. Such string seems to be from combosPending variable (which is an array), generated at:

	req.combo.done(function(mids, url) {

		(snipped...)

		combosPending.push(mids);

		(snipped...)

	}, req);

And elements in combosPending goes to defineModule()’s 1st parameter by the following code:

	// IE path: possibly anonymous module and therefore injected; therefore, cannot depend on 1-to-1,
	// in-order exec of onLoad with script eval (since it's IE) and must manually detect here
	targetModule = targetModule || injectingModule;
	if(!targetModule){

		(snipped...)

		if(has("dojo-combo-api") && !targetModule){
			for(var i = 0; i<combosPending.length; i++){
				targetModule = combosPending[i];
				if(targetModule.node && targetModule.node.readyState === 'interactive'){
					break;
				}
				targetModule= 0;
			}
		}
	}
	if(has("dojo-combo-api") && isArray(targetModule)){
		injectDependencies(defineModule(targetModule.shift(), args[1], args[2]));
		if(!targetModule.length){
			combosPending.splice(i, 1);
		}
	}

In above code, it appears that usage of combosPending is the only case targetModule being an array, so getModule() against targetModule.shift() seems the solution, which solved the error in my case.

Attachments (1)

dojo.js.patch (433 bytes) - added by Akira Sudoh 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by Akira Sudoh

Attachment: dojo.js.patch added

comment:1 Changed 8 years ago by Adam Peller

dup of #14198?

comment:2 Changed 8 years ago by Adam Peller

Cc: ddumont added
Priority: highestnormal
severity: blockermajor

also, please don't use highest/blocker, as they are not accurate for the Dojo project in general

comment:3 Changed 8 years ago by Adam Peller

Description: modified (diff)

comment:4 Changed 8 years ago by Akira Sudoh

Yes, it's a dup of 14198.

comment:5 Changed 8 years ago by bill

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.