首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Uncaught : c.querySelectorAll不是函数

Uncaught : c.querySelectorAll不是函数
EN

Stack Overflow用户
提问于 2019-06-30 10:54:24
回答 2查看 2.3K关注 0票数 10

在我正在开发的vue.js应用程序中,我突然发现Chrome检查器中出现了一个错误:

代码语言:javascript
复制
Uncaught TypeError: c.querySelectorAll is not a function

它总是阻止死刑的执行。当我还能继续的时候,它似乎不会引起任何额外的问题。但我不能这样工作,如果我必须点击几次后,每次点击继续。

在调试器中,我可以看到c是一个变量,引用DOM中的注释。它会影响不同的评论。但是所有的注释都有一个共同点,即它们是由vue.js插入的,这是动态元素的占位符。

在堆栈跟踪中,几乎没有我的代码(参见下面的示例)。

代码语言:javascript
复制
(anonymous) (content_script_bundle.js:16)
childList (async)
appendChild (vue.runtime.esm.js?2b0e:5711)
insert (vue.runtime.esm.js?2b0e:6036)
createComponent (vue.runtime.esm.js?2b0e:5980)
createElm (vue.runtime.esm.js?2b0e:5919)
addVnodes (vue.runtime.esm.js?2b0e:6100)
updateChildren (vue.runtime.esm.js?2b0e:6227)
patchVnode (vue.runtime.esm.js?2b0e:6313)
patch (vue.runtime.esm.js?2b0e:6476)
Vue._update (vue.runtime.esm.js?2b0e:3942)
updateComponent (vue.runtime.esm.js?2b0e:4060)
get (vue.runtime.esm.js?2b0e:4473)
run (vue.runtime.esm.js?2b0e:4548)
flushSchedulerQueue (vue.runtime.esm.js?2b0e:4304)
(anonymous) (vue.runtime.esm.js?2b0e:1980)
flushCallbacks (vue.runtime.esm.js?2b0e:1906)
Promise.then (async)
timerFunc (vue.runtime.esm.js?2b0e:1933)
nextTick (vue.runtime.esm.js?2b0e:1990)
queueWatcher (vue.runtime.esm.js?2b0e:4396)
update (vue.runtime.esm.js?2b0e:4538)
notify (vue.runtime.esm.js?2b0e:730)
reactiveSetter (vue.runtime.esm.js?2b0e:1055)
(anonymous) (Workspace.vue?7337:142)
Promise.then (async)
(anonymous) (Workspace.vue?7337:139)
loadPanel (Workspace.vue?7337:138)
mounted (Workspace.vue?7337:112)
invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
callHook (vue.runtime.esm.js?2b0e:4213)
insert (vue.runtime.esm.js?2b0e:3139)
invokeInsertHook (vue.runtime.esm.js?2b0e:6340)
patch (vue.runtime.esm.js?2b0e:6559)
Vue._update (vue.runtime.esm.js?2b0e:3942)
updateComponent (vue.runtime.esm.js?2b0e:4060)
get (vue.runtime.esm.js?2b0e:4473)
run (vue.runtime.esm.js?2b0e:4548)
flushSchedulerQueue (vue.runtime.esm.js?2b0e:4304)
(anonymous) (vue.runtime.esm.js?2b0e:1980)
flushCallbacks (vue.runtime.esm.js?2b0e:1906)
Promise.then (async)
timerFunc (vue.runtime.esm.js?2b0e:1933)
nextTick (vue.runtime.esm.js?2b0e:1990)
queueWatcher (vue.runtime.esm.js?2b0e:4396)
update (vue.runtime.esm.js?2b0e:4538)
notify (vue.runtime.esm.js?2b0e:730)
reactiveSetter (vue.runtime.esm.js?2b0e:1055)
(anonymous) (vue-router.esm.js?8c4f:2555)
(anonymous) (vue-router.esm.js?8c4f:2554)
updateRoute (vue-router.esm.js?8c4f:2013)
(anonymous) (vue-router.esm.js?8c4f:1891)
(anonymous) (vue-router.esm.js?8c4f:2000)
step (vue-router.esm.js?8c4f:1730)
step (vue-router.esm.js?8c4f:1737)
runQueue (vue-router.esm.js?8c4f:1741)
(anonymous) (vue-router.esm.js?8c4f:1995)
step (vue-router.esm.js?8c4f:1730)
(anonymous) (vue-router.esm.js?8c4f:1734)
(anonymous) (vue-router.esm.js?8c4f:1980)
(anonymous) (vue-router.esm.js?8c4f:1808)
iterator (vue-router.esm.js?8c4f:1959)
step (vue-router.esm.js?8c4f:1733)
step (vue-router.esm.js?8c4f:1737)
step (vue-router.esm.js?8c4f:1737)
runQueue (vue-router.esm.js?8c4f:1741)
confirmTransition (vue-router.esm.js?8c4f:1988)
transitionTo (vue-router.esm.js?8c4f:1890)
push (vue-router.esm.js?8c4f:2200)
push (vue-router.esm.js?8c4f:2581)
handler (vue-router.esm.js?8c4f:458)
invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
invoker (vue.runtime.esm.js?2b0e:2179)
original._wrapper (vue.runtime.esm.js?2b0e:6911)

原因是什么?我怎么才能修好它?它与最新的vue.js更新有关吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-06-30 10:58:33

这个GitHub问题告密了我。它与vue.js、webpack和角无关。这是由Ghostery引起的。

关闭Ghostery您的网页,问题就消失了。

票数 40
EN

Stack Overflow用户

发布于 2019-06-30 10:57:04

在调试器中,我可以看到c是引用DOM中注释的变量。

这就是问题所在。节点没有querySelectorAll节点也不喜欢。对他们来说没有意义。只有文档节点具有查询功能。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56824265

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档