#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)
Change History (5)
Changed 10 years ago by
Attachment: | uploader.profile.js added |
---|
comment:1 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed 10 years ago by
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.
sample profile to recreate build