Opened 8 years ago

Closed 8 years ago

#12756 closed defect (invalid)

Could not load **module.name** Dojo 1.6.0

Reported by: dwight Owned by: Rawld Gill
Priority: high Milestone: 1.7
Component: Loader Version: 1.6.0
Keywords: Cc:
Blocked By: Blocking:

Description

I ran across this problem trying to use Dojo and my modules in my web pages as viewed on my Android 2.2 phone's default browser (LG Optimus V). The dojo.js file loaded fine, but my 'dojo.require'd modules wouldn't load. Odd since they loaded on every other device, browser and operating system I have available to me to test with.

Background: using Dojo v1.6.0 (23917 as downloaded, not custom build), I would use code like this in the head of the page:

[code] <script type="text/javascript" src="../msos/demo_config.js"></script>

<script type="text/javascript" src="../dojo/dojo.js"></script>

<script type='text/javascript'> /* <![CDATA[ */

dojo.require("msos.common");

dojo.require("msos.display");

msos.display.set_size();

var intiate_page = function() {

msos.common.browser_current();

msos.common.browser_editable();

alert('Javascript is working just fine!');

}

dojo.addOnLoad(intiate_page);

/* ]]> */ </script> [code]

...where 'demo_config.js' is just my grouping of djConfig variables and some immediately needed script (input parsing).

This has always worked fine in the past (since ver. 1.2.0), and still did in everything except Android's default browser. So I decided to do a little investigation using the dojo.js.uncompressed.js version from the same Dojo download. Well, at least we now have consistency.

Now it errors all the time in any browser.

From Google Chrome Dev console:

GET http://free.opensite.mobi/test/undefined../msos/common.js 404 (Not Found)

...which of coarse is understandable since 'undefined' won't do much good. and:

Uncaught ReferenceError?: msos is not defined

intiate_page msos.html:38

dojo.loaded dojo.uc.js:716

dojo._callLoaded dojo.uc.js:822

dojo._modulesLoaded dojo.uc.js:805

dojo._loadInit

So I thought I would give you guys a heads-up that there may be problems for some people using similar code to mine. Anyway, the quick fix is to use:

dojo.registerModulePath("msos", "http://website_name/msos");

...and define the module path specifically. In my simple testing,

dojo.registerModulePath("msos", "../");

...did not work.

Change History (8)

comment:1 Changed 8 years ago by dwight

Several hours later...still can't get the Android default browser to load any one of my modules. Wouldn't even load a dojo named module (other than the original dojo.js). Here is a simple test page: http://free.opensite.mobi/simple_page.html

...that works fine in other browsers. I switched to dojo verison 1.5.0, but no joy. Anyone interested, please have a look and tell me it isn't something stupid that I am doing wrong.

Thanks in advance.

comment:2 Changed 8 years ago by bill

Owner: set to Rawld Gill

All the loader code has been revamped in 1.7 so it's possible the problem isn't occuring anymore.

comment:3 Changed 8 years ago by Rawld Gill

Status: newassigned

comment:4 Changed 8 years ago by Rawld Gill

Milestone: tbd1.7

comment:5 Changed 8 years ago by bill

Component: GeneralLoader

comment:6 Changed 8 years ago by Rawld Gill

Can you try this with 1.7 trunk.

comment:7 Changed 8 years ago by Chris Mitchell

Not sure if this is your exact problem, but Android doesn't like modules names with preceding underscore characters. To workaround this, try building all modules into layer files using a build first.

comment:8 Changed 8 years ago by Rawld Gill

Resolution: invalid
Status: assignedclosed

no activity on this ticket to indicate it's a problem in 1.7.

Note: See TracTickets for help on using tickets.