#15871 closed defect (fixed)
[regression] Parser fails if dijit/form/Form contains dijit/form/* before a script dojo/* regression in 1.8.0
Reported by: | Magnus Lidbom | Owned by: | bill |
---|---|---|---|
Priority: | undecided | Milestone: | 1.8.1 |
Component: | Parser | Version: | 1.8.0 |
Keywords: | Cc: | Kitson Kelly | |
Blocked By: | Blocking: |
Description
This causes an exception
<!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/dojo.js"></script> <script type="text/javascript"> require([ "dojo/parser", "dijit/form/CheckBox", "dijit/form/Form"], function (parser) { parser.parse(); }); </script> </head> <body class="claro"> <form action="/SomeUrl" data-dojo-type="dijit/form/Form"> <input data-dojo-type="dijit/form/CheckBox" name="ACheckBox" /> <script type="dojo/on" data-dojo-event="click"> </script> </form> </body> </html>
Error: An attempt was made to reference a Node in a context where it does not exist. at Object._1a.construct (http://ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/parser.js:8:4772) at Object.<anonymous> (http://ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/parser.js:8:1939) at Object._578.map (http://ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/dojo.js:15:141657) at Object._1a._instantiate (http://ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/parser.js:8:1785) at _1a.parse (http://ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/parser.js:8:9006) at _4b8 (http://ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/dojo.js:15:122572) at Promise._4b7.then._4c5.then (http://ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/dojo.js:15:124391) at Object._1a.parse (http://ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/parser.js:8:8961) at file:///C:/Manpower/DojoParserError.html:10:24 at _c5 (http://ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/dojo.js:15:11308)
As far as I could tell, debugging with the non-CDN version, the parser tries to access the script tag as if it was contained in the input tag rather than the form tag.
If I put the script tag before the input tag it works. If I put the input tag in a div it works.
Change History (9)
comment:1 Changed 8 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:2 Changed 8 years ago by
First: kudos on the efficient bug wrangling. My apologies about the messed up repro.
Unfortunately I only messed up the repro in the last stages of isolating the issue to something I could easily post here. The code below fails as I described. Originally I used dojo/domReady! and it fails in the same way.
Please reopen.
<!DOCTYPE html> <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.8.0/dojo/dojo.js"></script> <script type="text/javascript"> require([ "dojo/parser", "dojo/ready", "dijit/form/CheckBox", "dijit/form/Form"], function (parser, ready) { ready(function(){ parser.parse(); }); }); </script> </head> <body class="claro"> <form action="/SomeUrl" data-dojo-type="dijit/form/Form"> <input data-dojo-type="dijit/form/CheckBox" name="ACheckBox" /> <script type="dojo/on" data-dojo-event="click"> </script> </form> </body> </html>
comment:3 Changed 8 years ago by
Resolution: | invalid |
---|---|
Status: | closed → reopened |
Ah I see, OK, makes sense.
comment:4 Changed 8 years ago by
Milestone: | tbd → 1.8.1 |
---|---|
Summary: | Parser fails if dijit/form/Form contains dijit/form/* before a script dojo/* regression in 1.8.0 → [regression[ Parser fails if dijit/form/Form contains dijit/form/* before a script dojo/* regression in 1.8.0 |
Regressed in [28469].
comment:5 Changed 8 years ago by
Cc: | Kitson Kelly added |
---|---|
Summary: | [regression[ Parser fails if dijit/form/Form contains dijit/form/* before a script dojo/* regression in 1.8.0 → [regression] Parser fails if dijit/form/Form contains dijit/form/* before a script dojo/* regression in 1.8.0 |
You need to wrap the parser.parse() call in a call to dojo/ready.