【问题标题】:Please how do i handle this error "Unhandled Rejection (Type Error): Cannot read property 'filter' of undefined"请问我该如何处理这个错误“未处理的拒绝(Typeerror):无法读取未定义的属性'过滤器'”
【发布时间】:2021-03-28 06:52:28
【问题描述】:

我需要你的帮助。 我是 javascript/React 的新手。 我正在编写本教程https://github.com/Azure-Samples/js-e2e-client-cognitive-services,我收到此错误“未处理的拒绝(TypeError):无法读取未定义的属性'过滤器'”。 Attached is a screenshot

我们将不胜感激。

【问题讨论】:

    标签: javascript reactjs azure azure-static-web-app


    【解决方案1】:

    似乎变量analysis.tags 未定义。

    您可以使用console.log(analysis) 来检查该值。

    【讨论】:

      【解决方案2】:

      您可以在执行任何操作之前对标签对象添加检查

      tags && tags.filter(your remaining code)
      

      【讨论】:

        猜你喜欢
        • 2020-06-20
        • 2020-04-29
        • 2021-01-13
        • 1970-01-01
        • 2019-04-07
        • 2021-05-06
        • 2021-12-13
        • 2019-07-19
        • 2019-06-03
        相关资源
        最近更新 更多