Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#14820 closed defect (worksforme)

async: 'legacyAsync' on same-domain causes modules to doubly load

Reported by: Colin Snover Owned by: Rawld Gill
Priority: undecided Milestone: 1.7.3
Component: Loader Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:


Taking the code at, pointing to a same-domain built version of Dojo 1.7.2 and setting data-dojo-config="async: 'legacyAsync'" causes the dojo.require'd modules to be loaded once with script injection and then again with XHR.

Change History (4)

comment:1 Changed 10 years ago by Rawld Gill

Status: newassigned

I'm not sure of the precise config you are testing. I'm assuming you're using a document like this

	<meta charset="utf-8">
	<script data-dojo-config="async:'legacyAsync'" src="release/dojo/dojo/dojo.js"></script>
		require(["dojo"], function(dojo){
		// New: Require in the dojo.fx module

		// Remember, dojo.ready waits for both the DOM and all dependencies
			// The piece we had before - change our innerHTML
			dojo.byId("greeting").innerHTML += ", from " + dojo.version;

			// Now, slide the greeting
				top: 100,
				left: 200,
				node: dojo.byId("greeting")


	<h1 id="greeting">Hello</h1>

Notice that this is different than the example in that the code is surrounded by

require(["dojo"], function(dojo){
// etc.

This is necessary because dojo is not automatically loaded when async is set to anything other than falsy. I think it is arguable that this should be changed.

In any event, this configuration loads correctly without double loads.

Please provide a the precise document that is causing the problem against a standard build.


comment:2 Changed 10 years ago by Rawld Gill

Resolution: worksforme
Status: assignedclosed

comment:3 Changed 10 years ago by Colin Snover

Hi Rawld,

The document that causes a problem is the one you were working with except without the extra wrapper. 1.6- loaded cross-domain loaded Dojo Base, so not sure why legacyAsync would/should not. Can you elaborate?


comment:4 Changed 10 years ago by Colin Snover


Could you please respond to my question from three weeks ago?


Note: See TracTickets for help on using tickets.