Basically, if you specify the id in options.change AND add the data-turbolinks-temporary attribute to the nodes you want replaced, they get added to the list of nodesToChange twice.
The first time through, everything works fine.
The second time through, the parents have already been removed from the nodes and an exception is thrown when trying to traverse existingNode.parentNode.
Here's how I am invoking Turbolinks.visit() to get this error:
A quick filter on the list of nodes to change. Without this, I'm seeing errors in swapNodes on this line (turbolinks.js.coffee:201):
Basically, if you specify the id in options.change AND add the
data-turbolinks-temporary
attribute to the nodes you want replaced, they get added to the list of nodesToChange twice.The first time through, everything works fine.
The second time through, the parents have already been removed from the nodes and an exception is thrown when trying to traverse
existingNode.parentNode
.Here's how I am invoking Turbolinks.visit() to get this error:
Here's the markup:
As a workaround, I just changed options.change to true, and that avoided the duplication.
This patch has a fix to avoid it from happening all together.