Here is sample code you can uncomment to see, when prepend gets called it looks like an opal connect dom instance is being added into the oga document. Calls to oga methods that then access this part of the Dom generated errors (such as the length invocation in the linked code):
https://github.com/roupen/autolink.cuba/blob/0db3c4fca3af03687414d875c6388573303ff8e2/app/components/reports/display.rb#L484-L487