简体   繁体   English

Vue 已停止在控制台中显示错误

[英]Vue has stopped showing errors in the console

I'm debugging a Vue/Nuxt app.我正在调试一个 Vue/Nuxt 应用程序。 For some unknown reason I'm no longer seeing errors in the console when my Javascript references a function or variable that does not exist.由于某些未知原因,当我的 Javascript 引用 function 或不存在的变量时,我不再在控制台中看到错误。 Instead, it just fails silently.相反,它只是默默地失败。 For example,例如,

methods: {
    foo() {
        doesNotExist();
    }
}

When I call foo() nothing happens, in both Firefox and Chrome.当我调用 foo() 时,Firefox 和 Chrome 都没有任何反应。 I used to see an error in the console.我曾经在控制台中看到错误。

I don't know whether this is Vue thing, a Nuxt thing, or a plain Javascript thing.我不知道这是 Vue 的东西,Nuxt 的东西,还是普通的 Javascript 的东西。

What did I do to mess things up?我做了什么把事情搞砸了?

Possibly Try:可能尝试:

methods: {
foo: function() {
    doesNotExist();
}

My personal recommendation is that you use typescript for frameworks like Vue because TypeScript is a pseudo static language that compiles into javascript (dynamic) meaning that debugging becomes infinitely easier. My personal recommendation is that you use typescript for frameworks like Vue because TypeScript is a pseudo static language that compiles into javascript (dynamic) meaning that debugging becomes infinitely easier. It'll raise errors directly in VSCode without having to debug from devtools.它将直接在 VSCode 中引发错误,而无需从 devtools 进行调试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM