Skip to content

fix Uncaught TypeError: e.querySelector is not a function at uni-app-view.umd.js #5371

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

Open
wants to merge 2 commits into
base: next
Choose a base branch
from

Conversation

kumv-net
Copy link

@kumv-net kumv-net commented Mar 30, 2025

启动时报错
出现错误 e.querySelector is not a function at uni-app-view.umd.js
Uncaught TypeError: e.querySelector is not a function at uni-app-view.umd.js:17689

Uncaught TypeError: e.querySelector is not a function at uni-app-view.umd.js:17689
@kumv-net
Copy link
Author

认真查了下这个bug是使用者uni.createIntersectionObserver([this], [options])写法不严谨导致,例如uni.createIntersectionObserver( [options]);不传this元素。.observe(监听的selector查找在this 根节点上。querySelector查找的是子元素内容不包含自身。
微信截图_20250330234159
微信截图_20250330234724
汇总下问题 方便后来者
ijry/uview-plus#667
https://ask.dcloud.net.cn/question/165053
https://ask.dcloud.net.cn/question/200862
https://ask.dcloud.net.cn/question/173360
https://ask.dcloud.net.cn/question/178500
之下有注释uni.createIntersectionObserver就失效, 或者 有page-meta节点也失效:
https://ask.dcloud.net.cn/question/191660

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

Successfully merging this pull request may close these issues.

1 participant