TypeError (null reference exception) when using dom-construc

TypeError (null reference exception) when using dom-construct.place

本文关键字:when using dom-construc exception null reference TypeError      更新时间:2023-09-26

类型错误: 无法读取 null 的属性"所有者文档" {堆栈:(...),消息:"无法读取 null 的属性'所有者文档'"}

升级道场后在下一行中遇到上述错误。有谁知道我该如何修复它,或者我应该将其报告为错误?

require([..., "dojo/dom-construct"], function(..., domConstruct) {
    //some code
    domConstruct.place(legPic, curLayer.id + '_chkBox_' + curLegLyr.layerId, "after");
});

curLayer.id + '_chkBox_' + curLegLyr.layerId可能引用了在domConstruct.place调用时文档中实际上不存在的 ID。

(该错误对应于 Dojo 源中的此行。