【问题标题】:Uncaught (in promise) TypeError: Cannot read properties of null (reading 'error')Uncaught (in promise) TypeError: Cannot read properties of null (reading 'error')
【发布时间】:2021-09-25 08:16:52
【问题描述】:

我正在使用 VueJS 并遇到此错误。 如何解决这个问题?

【问题讨论】:

  • 请提供足够的代码,以便其他人更好地理解或重现问题。

标签: visual-studio vue.js vuejs2 typeerror


【解决方案1】:

在您的代码中找到对xyz.error 的引用。 xyz 的值设置为值null,而不是属性错误的对象。

尝试文本搜索值.error

【讨论】:

    【解决方案2】:

    将文件中的 xyz.error 替换为“typeof xyz != undefined && typeof xyz.error != undefined”

    【讨论】:

    • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
    猜你喜欢
    • 2021-12-21
    • 2021-12-12
    • 2022-07-01
    • 2022-01-11
    • 2021-11-10
    • 2022-01-11
    • 1970-01-01
    • 2022-10-09
    • 2022-07-21
    相关资源
    最近更新 更多