简体   繁体   中英

Please how do i handle this error “Unhandled Rejection (Type Error): Cannot read property 'filter' of undefined”

I need your help. I am a newbie with javascript/React. I am working on this tutorial https://github.com/Azure-Samples/js-e2e-client-cognitive-services and I get this error "Unhandled Rejection (TypeError): Cannot read property 'filter' of undefined". Attached is a screenshot

Responses will be greatly appreciated.

It seems like the variable analysis.tags is undefined.

You can use console.log(analysis) to checkout the value.

You can add check on tags object before doing any action

tags && tags.filter(your remaining code)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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