Most likely your local AWS SDK is old/not updated. Another possibility - since this function has been relatively recently added, if you are relying on AWS SDK Lambda image (that is, you don't ship your own AWS SDK as shared layer) then you could see the same problem.
Try adding your own AWS SDK (make sure the Expense function is in your SDK) as shared layer to your Lambda, redeploy and try again.
Thanks for using our service! As we launch AnalyzeExpense recently, you probably need to get the latest SDK before calling AnalyzeExpense API. You can download the SDK from https://github.com/aws and make sure you are available to see AnalyzeExpense API locally. If the issue is still there after installing the latest SDK, please don't hesitate to let us know.
Did anyone manage to fix this issue? We're getting the same error in production (works fine locally) with the correct SDK version and settings. I'm not sure if it's because we've deployed it on a Lambda or if there's some other issue.
I ended up fixing this error by using the v3 SDK instead of v2.965.0.
Really quite strange since Textract is supposed to be supported in v2.965.0 - I even took a peek at the code myself to confirm. If anyone else is having similar issues but still relies on some v2 functionality like we do (because v3 S3 is broken for us, go figure) - you can just install
@aws-sdk/client-textract and use that separately.
Hope this helps someone in the future!
[Announcement] Amazon Textract adds synchronous support for single page PDF documents and support for PDF documents containing JPEG 2000 encoded imagesasked 10 months ago
AWS Textract security - sharing dataAccepted Answer
Human Revision with Textract Expensesasked 7 months ago
AnalyzeExpense - Analyzing Invoices and Receiptsasked a year ago
Textract AnalyzeExpense: Standard Fields not detectedasked 5 months ago
AWS Textract Invoice Scanner custom field
Textract analyze.Expense throwing an error, "not a function"asked a year ago
Textract - How to extract just certain fieldsasked 10 months ago
PDF files with multiple pages does not workasked 4 months ago
Inconsistent results from Textractasked 10 months ago