Opened 9 years ago

Closed 8 years ago

#13016 closed defect (fixed)

dojo.parser.parse is not called if first (or only) in requires list

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

Description (last modified by bill)

SVN rev 25068, Ubuntu linux 10.10, rhino build. This error only seems to occur in a build (using any profile), 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 a build, if I list dojo/parser as first (or only component) in the list of requires, it will not be triggered. If listed second or later, it is triggered.

To test this, I put an alert in dojo.parser.parse (in my build output file: uploader.js.uncompressed.js). This probably isn't necessary as you could just observe the debug console or see the non-rendered page in the browser.

FAILS to call parser:

require([
    "dojo/parser"
    ],
    function(
        parser
    ){ ... });

OR:

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

Switching the order, and requiring two components will trigger the parser:

require([
    "dijit/layout/ContentPane",
    parser
    ],
    function(
        ContentPane,
        parser
    ){ ... });

See attached profile file and test html. In this example, the parser may not fully complete, but this bug is focused only on the structure of the requires array and how that affects the triggering of parse. You may see "Object does not have 'trim' method" in the console. For that, see bug #13011.

Attachments (2)

cptest.html (844 bytes) - added by rott 9 years ago.
test html file to reproduce the problem
uploader.profile.js (1.1 KB) - added by rott 9 years ago.
test profile to reproduce the build

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by rott

Attachment: cptest.html added

test html file to reproduce the problem

comment:1 Changed 9 years ago by bill

Component: GeneralBuildTools
Description: modified (diff)
Owner: set to Rawld Gill

Changed 9 years ago by rott

Attachment: uploader.profile.js added

test profile to reproduce the build

comment:2 Changed 9 years ago by rott

Oops, I messed up the syntax in that third code block. The bug is still valid. (And I'll do a better job with my wiki syntax. :)

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

comment:3 Changed 8 years ago by Rawld Gill

Resolution: fixed
Status: newclosed

Could not duplicate after [25156].

Note: See TracTickets for help on using tickets.