Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#11510 closed defect (fixed)

With debugAtAllCosts enabled, getting a cross-domain error

Reported by: Mark Mathews Owned by: James Burke
Priority: high Milestone: 1.5.1
Component: Core Version: 1.5
Keywords: Cc:
Blocked By: Blocking:


uncaught exception: Could not load cross-domain resources: dojox.grid.DataGrid?

Environment: dojo-release-1.5.0 installed locally (localhost development env) Firefox/3.5.10 w/ Firebug1.5.4 enabled Chrome/5.0.375.99 w/ Javascript console enabled

Attachments (1)

11510.patch (486 bytes) - added by James Burke 11 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 11 years ago by ben hockey

debugAtAllCosts is equivalent to "use cross-domain loader" so don't let the error message alarm you at all - you are most likely not making any cross-domain requests.

there is a very common gotcha when using this loader. it is asynchronous and the 'usual' loader is synchronous. because of this, can you attach a minimal failing test case so that we can determine if this is actually an error with dojo or if it is a misunderstanding about how to use this loader?

comment:2 Changed 11 years ago by Mark Mathews

I'm not just posting about console spam (I'm used to that by now ;-).

This is a regression.

In both the browsers I tested, loading stopped at that point and the app failed to run. I had to turn off debugAtAllCosts to continue work.

This is a configuration that worked fine w/ 1.4.3. All I did was install 1.5 and change the dojoroot symlink on my server.

Actually, I've switched back to 1.4.3 for the time being.

comment:3 Changed 11 years ago by James Burke

It would be good to get perhaps a test page, or a bit more information. It is just a local 1.5.0 release with a dojo.require("dojox.grid.DatGid?"); with a djConfig.debugAtAllCosts = true? Any other requires or a different require?

comment:4 Changed 11 years ago by Mark Mathews

This is happening in an app w/ 4 module files (so far) and none of them require DataGrid?. I do have a require for EnhancedGrid? so I'm guessing that's where the require is coming from.

I'll see if I can get more info about where/why the exception is thrown; Also see if I can distill a small file that will exhibit the problem.

comment:5 Changed 11 years ago by Mark Mathews

I grabbed just the bits that seem to be involved. Here's a test page that fails. Be patient, this would appear to be associated with a 15 second timeout:

Failure is observed with:

  • Fedora/3.5.10-1.fc12 Firefox/3.5.10 + Firebug-1.5.4, and
  • Chrome/5.0.375.99

The unfortunate part doesn't fail with the 1.5.0-src tree:

comment:6 Changed 11 years ago by James Burke

Component: GeneralCore
Milestone: tbd1.5.1
Owner: changed from anonymous to James Burke

I tracked this issue down to a change in dojo.parser and how the xd loader tries to find dependencies: the loader tries to remove comments by using a very dumb regexp for speed. However, since Dojo 1.4.3, dojo.parser has a change where the regexp on line 397 looks like the start of a comment with the characters.

I will attach a patch that should fix the comment issue, but still needs more testing. It should be fine though. Unfortunate we need this change, but doing proper comment detection would take lots more lines of code and it would be slower.

Changed 11 years ago by James Burke

Attachment: 11510.patch added

comment:7 Changed 11 years ago by James Burke

Impact of this bug: Any optimized layer that includes dojo.parser in it that has been minified by the build, then run in debugAtAllCosts mode from the same domain as dojo.js (not the .xd.js versions of the files) will encounter this problem. The .xd.js version of the files are be fine.

comment:8 Changed 11 years ago by bill

He he, OK good catch, the parser change looks fine to me.

comment:9 Changed 11 years ago by James Burke

(In [22670]) Refs #11510: fix issue with regexp looking like a comment for debugAtAllCosts removal.

comment:10 Changed 11 years ago by James Burke

Resolution: fixed
Status: newclosed

(In [22671]) Fixes #11510: fix issue with regexp looking like a comment for debugAtAllCosts removal.

comment:11 Changed 11 years ago by Ben Lowery

(In [22688]) Merged revisions 22670,22679-22681 via svnmerge from

Had to merge a conflict in _base/_loader/bootstrap.js. Seemed harmless, just a whitespace / var consolidation change.


r22670 | jburke | 2010-08-04 00:03:14 -0400 (Wed, 04 Aug 2010) | 1 line

Refs #11510: fix issue with regexp looking like a comment for debugAtAllCosts removal.


r22679 | kzyp | 2010-08-05 17:21:51 -0400 (Thu, 05 Aug 2010) | 1 line

Initial commit of, a RESTful implementation of Dojo object store, refs #11537


r22680 | kzyp | 2010-08-05 17:35:29 -0400 (Thu, 05 Aug 2010) | 2 lines

Added ObjectStore? adapter for new object store to dojo data, refs #11537


r22681 | dante | 2010-08-05 18:15:33 -0400 (Thu, 05 Aug 2010) | 1 line

fixes #11511 - deprecate djConfig attribute and global. use dojoConfig global or data-dojo-config attribute. updates tests, adds regression test for djConfig \!strict


Note: See TracTickets for help on using tickets.