Getting error TypeError: "ancestor.contains is not a function"
- Dominant language
- HTML
- Stars
- 172
- Forks
- 180
- PR merge metrics
- No merged PRs in 30d
Description
Hi, We are getting the following error after migrating from dojo 1.7 to 1.16.2
```
dojo/parser::parse() error TypeError: "ancestor.contains is not a function"
isDescendant Dojo
check dijit/focus.js:58
Dojo 3
hitch
dispatcher
destroy
_createDojoDeferredTypes datastage/widget/_DeferredLoadMixIn.js:116
startup datastage/widget/layout/TabContainer.js:66
startup dijit/_WidgetsInTemplateMixin.js:101
forEach Dojo
startup dijit/_WidgetsInTemplateMixin.js:99
startup dijit/_WidgetBase.js:573
forEach Dojo
startup dijit/_WidgetBase.js:571
inherited__debug Dojo
startup dijit/layout/_ContentPaneResizeMixin.js:54
inherited__debug Dojo
startup dijit/layout/ContentPane.js:203
startup dijit/_WidgetBase.js:573
forEach Dojo
startup dijit/_WidgetBase.js:571
inherited__debug Dojo
startup dijit/layout/_LayoutWidget.js:60
inherited__debug Dojo
startup dijit/layout/LayoutContainer.js:58
startup dijit/_WidgetsInTemplateMixin.js:101
forEach Dojo
startup dijit/_WidgetsInTemplateMixin.js:99
Dojo 14
onConstruct
forEach
onConstruct
signalListener
then
_instantiate
p
signalListener
then
parse
hitch
onEvent
processQ
detectReady
dojo/parser.js:900:14
Dojo 9
```
It looks like a widget is passed to isDescendant() while the only accepted values are DOM ID string or a DOM node.
See the discussion in the issue that we have opened regarding. isDescendant function.
https://github.com/dojo/dojo/issues/375
Contributor guide
Research direction
Start by reading dijit/focus.js:58 and dojo/parser.js:900, then compare the migration behavior with the discussion in dojo/dojo#375. Reproduce the startup failure around datastage/widget/_DeferredLoadMixIn.js:116 and determine whether a widget reaches isDescendant where a DOM node is expected. Done means the reported error is reproduced and its cause or fix is established.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100