Closed gaokun closed 12 months ago
According to insertBefore API doc:
Note: referenceNode is not an optional parameter. You must explicitly pass a Node or null.
so we have to pass null, if referenceNode is undefined for 2nd parameter.
null
referenceNode
undefined
insertBefore
appendChild
But happy-dom doesn't, it is strict as API said. check this code
happy-dom
Root Cause
According to insertBefore API doc:
so we have to pass
null
, ifreferenceNode
isundefined
for 2nd parameter.References:
1.
insertBefore
equalsappendChild
whenreferenceNode
is null, refer to Vue source code2. In Chrome, Firefox, Safari, it works when
referenceNode
isundefined
, the same asnull
dose.But
happy-dom
doesn't, it is strict as API said. check this code3. An issue in ant-design-vue was caused by this.