ShizuruS
BuildShip2y ago
4 replies
Shizuru

Type 'unknown' when trying to use API

Hi, i'm trying to use API from openfoodfacts. I've followed the tutorial but still getting error "Property 'product_name' does not exist on type 'unknown' ". I've tried various options but the closest one is when my result in test mode shows {"name": undefined}. Any help would be appreciated 🥹
1.png
2.png
3.png
Solution
@Shizuru You'll require to pass the barcode as key and the actual barcode in the value then test. Ensure you match the key as it is case sensitive.
image.png
Was this page helpful?