Open DongZeMan opened 1 day ago
The first error "a disconnected element was passed" indicates that the start/end element of one of the lines is no longer present in the dom. can you send me a snippet of the code throwing these errors please.
I enclose a picture for you
are you sure you're not removing the elements at some point afterwards ?
是的,但是我目前是作为microapp的子应用,才导致了这个问题,所以想咨询一下有没有什么解决方案
still not understood, are you saying there is a bug in linkerline or in the original leader-line project that you would like me to fix it ?
不是的,我只是想知道问题是出在linkerline还是microapp
然后还有就是想知道您有没有碰到过类似问题,如果有的话想请教一下解决方案
as you can see the error file is LeaderLine.js, that's the original project code, so the issue is either with your app or leader-line's.
yes I did regenerate it just a sec ago, i created a line and after that called line.start.remove() and tried to reposition the line. As I told you, start/end element is no longer in the dom.
但是我当前项目不作为microapp的子应用,这个项目单独运行是没有问题的,并且我自己并没有对dom进行任何操作,所以我也不知道具体问题出在哪边
但是我在new LinkerLine之前对parent,start,end都进行了判断,判断它们都不为null之后,再new LinkerLine,报错还是一样,我也尝试过在setTimeout中去执行,延时为5000ms,依旧是报错,报错内容都一样
can you share your code in stackblitz or something similar ?
github仓库可以吗
if it's public why not, just send the link
代码内容不是最新的,但是同样能复现出对应的效果
faced this error App.vue:41 Uncaught TypeError: Cannot read properties of undefined (reading 'addGlobalDataListener') commented line 40-41 in App.vue and the linkerline is getting instantiated. can't see what you're facing exactly.
因为这个项目我是作为microapp的子系统去嵌入的,您现在应该是单独运行这个项目,所以需要注释掉一些代码,注释掉40行到42行的代码就可以单独运行了,但是我希望的是通过base-project-vite无访问child-project-vite-1,也就是http://localhost:5173/child-app-1这种形式去访问http://localhost:5678,这种方式下则会复现之前的报错
复现步骤是,先运行child-project-vite-1,然后再运行base-project-vite,然后访问http://localhost:5173,再点击第一个菜单,打开控制台就能看到报错了
I get it now, when accessing the micro-app server directly np but when accessin it from the base app, it generates that error. It seems to be an issue with the leader-line code itself, same error when using leader-line I guess ?
如果不使用linkerline,使用leaderline,也会有一模一样的错误
不管使用leaderline还是linkerline,child-project-vite-1自己单独运行都不会报错
执行new LinkerLine之前都是可以打印出DOM元素的,但是不知道为什么new LinkerLine就开始报错了
Then the issue has nothing to do with the linkerline but with the leaderline itself as linkerline is built on top of the latter. I'll try to investigate this, meanwhile, you do the same. But why are you trying to show a subapp inside another app, never seen this tbh.
好的,最开始我准备询问leaderline的作者,但是leaderline的issue已经不让新建了,所以我没有办法找到作者了,至于为什么要在一个应用程序中显示一个子程序,那是因为我们需要做一个微应用的站点,就是要在主应用中去访问一些接入的子应用程序
can you use an iframe instead and see if that works, just to test it.
使用iframe嵌入的话,不会报错
但是我们技术栈要求是microapp
最近开始用microApp整合之前的项目,当嵌入其中一个使用了linkerline的子应用时,控制台抛出来一个错误 能告知下是什么原因吗?