Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MetingJS v2.0.1 与 [email protected] 存在冲突? #66

Open
ohmykreee opened this issue Oct 9, 2021 · 2 comments
Open

MetingJS v2.0.1 与 [email protected] 存在冲突? #66

ohmykreee opened this issue Oct 9, 2021 · 2 comments

Comments

@ohmykreee
Copy link

  • 使用版本
    APlayer v1.10.1 af84efb
    MetingJS v2.0.1
    [email protected]

  • 现象
    APlayer 出现重复
    屏幕截图 2021-10-09 141224
    控制台报错(该报错重复三次):

Uncaught TypeError: Cannot read properties of undefined (reading 'destroy')
    at HTMLElement.disconnectedCallback (Meting.min.js:formatted:30)
    at xe ([email protected]:formatted:1872)
    at He ([email protected]:formatted:2284)
    at S.fn.init.append ([email protected]:formatted:2364)
    at S.fn.init.wrapAll ([email protected]:formatted:3838)
    at HTMLBodyElement.<anonymous> ([email protected]:formatted:3847)
    at Function.each ([email protected]:formatted:160)
    at S.fn.init.each ([email protected]:formatted:78)
    at S.fn.init.wrapInner ([email protected]:formatted:3844)
    at at (jquery.overlayScrollbars.min.js:13)

生成的 HTML 代码如下:
屏幕截图 2021-10-09 141939

取消使用 jQuery 后该问题不出现。

(我不会前端,js 代码也不会读,希望各位大佬能帮一帮忙)

@metowolf
Copy link
Owner

metowolf commented Oct 9, 2021

可以提供下能够复现的最小 html 代码

@ohmykreee
Copy link
Author

<!DOCTYPE html>

  <head>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/css/OverlayScrollbars.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css" />
    </head>

  <body class="default">
    <meting-js server="netease" type="song" id="1880127698"></meting-js>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
    <script src="https://cdn.jsdelivr.net/npm/[email protected]/js/jquery.overlayScrollbars.min.js"></script>
    <script src="/js/main.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>   
  </body>

</html>

由于原来的页面使用了模板,第 12 行的 main.js 来自 https://github.com/g1eny0ung/hugo-theme-dream/blob/master/static/js/main.js

所以分析下来其实并不是 MetingJS 和 jQuery 有冲突,而是模板里的其他 js 文件了?

@ohmykreee ohmykreee changed the title MetingJS v2.0.1 与 [email protected] 存在冲突? MetingJS v2.0.1 与 [email protected] 存在冲突? Oct 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants