loading-bar icon indicating copy to clipboard operation
loading-bar copied to clipboard

Conflict between tiptap and loadingio/loading-bar

Open PedroJBrito opened this issue 3 years ago • 1 comments

Hi,

I'm using nextjs and I have a page wich displays a chart using the library loadingio/loading-bar. Then I have a button to display an editor, where tiptap comes in, and that's when the problem appears. In isolation both libraries works fine, however when I have the chart already displayed and then I add the tiptap on that page the app brokes.

I have this simple demo where you can reproduce the problem by clicking on the button, which is a similar approach to what I have in my app.

https://codesandbox.io/s/tiptap-loadingio-fr4fj1

Thank you for your help.

PedroJBrito avatar Jun 23 '22 11:06 PedroJBrito

I don't have a fix, but I do have an explanation. In lib/loading-bar.js at line 160 is this line of code:

x$ = document.body.proto.proto.proto;

After that, x$ replaces functions with its own version. Keep in mind that x$ is a reference to document.body's prototypes. In other words, loading-bar.js is replacing global functions with its own and this is leading to conflicts and runtime errors. It also appears that this is being addressed in the dev branch. But there no indication it will be released in the near future.

aatb avatar Jul 29 '22 17:07 aatb