Closed gritvald closed 1 month ago
I've found the issue.
I had defined a custom Node
class that shadowed the built-in Node
. This was the reason why insertNodesBefore
was scheduling a settling task for text nodes - TEXT_NODE
was undefined
in my custom Node
class, which is why the following test was always passing:
if (child.nodeType !== Node.TEXT_NODE && child.nodeType !== Node.COMMENT_NODE) {
settleInfo.tasks.push(makeAjaxLoadTask(child))
}
htmx version: 2.0.2
I have the following input:
The
/search
endpoint returns HTML with some newlines at the top and bottom of the response (line numbers are not part of the response):An exception is thrown from the
getInternalData
function because theelt
param has anull
value:Below is the value of the
child
variable from themakeAjaxLoadTask
function call frame:Next,
child
is passed toasElement
, which returnsnull
, which is then passed through theprocessNode
->initNode
->getInternalData
call chain:When I strip leading and trailing newlines from the response everything works fine.
Maybe it's somehow related to #2613 and #2913.