Estoy buscando ayuda en mi proyecto de cliente de texto. Estoy tratando de seguir la documentación de AWS Textract, pero estoy atascado en texttractClient.send(). Recibo el error URL.hostname no está implementado
Seguí los pasos en AWS para configurar mi IAM, S3 y actualicé mis archivos ~/.aws/config y de credenciales. Omití un par de campos, pero aquí está mi código:
import { AnalyzeExpenseCommand } from "@aws-sdk/client-textract"; import { TextractClient } from "@aws-sdk/client-textract"; ... const textractClient = new TextractClient({ region: 'us-east-1' }); const bucket = 'scannsplit-s3-bucket' const photo = 'Sojuba.png' // Set params const params = { Document: { S3Object: { Bucket: bucket, Name: photo }, }, } ... const process_text_detection = async () => { try { const aExpense = new StartExpenseAnalysisCommand(params); console.log(aExpense); const response = await textractClient.send(aExpense); console.log(response); return response; // For unit tests. } catch (error) { console.log('Error: ' + error); } } ... process_text_detection() is being called with a buttonLo que probé: me encontré con esta otra publicación Error "URL.hostname no está implementado", AWS SNS en React Native Android que parece tener un problema similar. Probé la solución y después de instalar react-native-url-polyfill y react-native-get-random-values , recibí el error Native module is not found . Intenté buscar soluciones para ese error, pero tampoco tuve mucha suerte.
Cualquier ayuda es muy apreciada.