Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#13017 closed defect (fixed)

dijit.layout.ContentPane not in _ctorMap in a build

Reported by: rott Owned by: Rawld Gill
Priority: high Milestone: 1.7
Component: BuildTools Version: 1.6.1
Keywords: Cc:
Blocked By: Blocking:

Description

SVN rev 25068, Ubuntu linux 10.10, rhino build. This error only seems to occur in a build (using any profile requiring ContentPane?), not with src.

Build command:

./build.sh profile=uploader version=1.7.0 action=clean,release stripConsole=all layerOptimize=shrinksafe optimize=shrinksafe releaseDir=../../../ cssOptimize=comments releaseName=dojo_optimized copyTests=false

In this build, I get the error "Cannot load class ContentPane?". I put a breakpoint in the debug console on Chrome to view some of the data at the point the error is thrown. It appears dojo.parser.instantiate function is expecting "dijit.layout.ContentPane?" to be a key to a valid value into the _ctorMap array, but alas, it is mapped to "undefined".

Please see attached profile and test html to reproduce. Also see screen shot of debug console. (I split the vars into their own definition lines so I could set an accurate breakpoint.)

Also, I'm not concerned with whether my HTML is valid or not, I just expect this to work, given that it does complete when using Dojo src.

Attachments (3)

uploader.profile.js (1.1 KB) - added by rott 9 years ago.
sample profile to recreate build
cptest.html (844 bytes) - added by rott 9 years ago.
test html file to reproduce the problem
dojobug-1.jpg (49.6 KB) - added by rott 9 years ago.
screengrab of var states in chrome

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by rott

Attachment: uploader.profile.js added

sample profile to recreate build

Changed 9 years ago by rott

Attachment: cptest.html added

test html file to reproduce the problem

Changed 9 years ago by rott

Attachment: dojobug-1.jpg added

screengrab of var states in chrome

comment:1 Changed 8 years ago by Rawld Gill

Resolution: fixed
Status: newclosed

(In [25156]) added feature to write absolute module id to layer files per insertAbsMids build switch; improved handling of package main config variable in loader and builder; fixes #13017; !strict

comment:2 Changed 8 years ago by Rawld Gill

rott: thanks for the report and the great hints!

I found a couple of issues.

1. Using script injection is deprecated. You should use require like this:

require(["dojo/uploader", "dijit/layout/ContentPane", "dojo/parser"], function(){//...

That said, the build switch "insertAbsMids" set to truthy will make script injection work. Try the following command line:

./build.sh profile=uploader version=1.7.0 action=clean,release stripConsole=all layerOptimize=shrinksafe optimize=shrinksafe releaseDir=../../../ cssOptimize=comments releaseName=dojo_optimized copyTests=false insertAbsMids=1

Alas, the build app had a bug when that switch was used with a layer. That's fixed in [25156].

2. The usage of dojo.addOnLoad is incorrect in the cptest.html file. I suspect this was just a typo because the code failed before there. In any event, the best practice would be to write:

<script type="text/javascript">
  require(["dojo/uploader", "dijit/layout/ContentPane", "dojo/parser"], function(){
	dojo.addOnLoad(function(){
		alert('Loaded!');
	});
  });
</script>

3. There was a typo in dijit/package.json and an unforgiving process in the build app that caused the typo to cause an error. That was also fixed in [25156]

With all of this, you test app seems to load correctly.

Note: See TracTickets for help on using tickets.