生产中的一段代码没有任何变化。但是现在我收到报告说每几百次模板无法加载并且页面崩溃。我正在使用 vue 2.16。
错误是:
[Vue warn]: Cannot find element: #my-component-template
[Vue warn]: Template element not found or is empty: my-component-template
[Vue warn]: Failed to mount component: template or render function not defined.
我还注意到 vue developer plugin 显示和两个根组件。当它没有崩溃时,它只显示一个。
我可以从哪里开始调试?由于它很少发生,因此很难调试。代码库很大而且很旧,不是我的,但它之前(以某种方式)工作过。可能是因为服务器太慢,有些东西是异步调用的?生产服务器承受了更大的压力,事情也变慢了。
任何提示或研究方向表示赞赏!
谢谢
我有同样的问题。我通过将我所有的 vue 代码放入一个
$(document).ready(function() {
// ...Vue code here..
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句