这是我正在使用的AWS JS SDK的src:
<script src="https://sdk.amazonaws.com/js/aws-sdk-2.487.0.min.js"></script>
Latest SDK可以在这里找到。
在aws中设置认知身份并将aws凭证添加到js代码之后。
当我编写此代码时:
var textract = new AWS.Textract();
它显示此错误:
未捕获的TypeError:AWS.Textract不是构造函数
当我在浏览器支持列表中检查了特定sdk版本- SDK-release notes的发行说明时,没有提到Textract。
但是仍然有一个Javascript文档: AWS Textract
AWS对象内容:
Object
ACM: ƒ ()
APIGateway: ƒ ()
ApplicationAutoScaling: ƒ ()
AutoScaling: ƒ ()
CUR: ƒ ()
ChainableTemporaryCredentials: ƒ (e)
CloudFormation: ƒ ()
CloudFront: ƒ ()
CloudHSM: ƒ ()
CloudTrail: ƒ ()
CloudWatch: ƒ ()
CloudWatchEvents: ƒ ()
CloudWatchLogs: ƒ ()
CodeBuild: ƒ ()
CodeCommit: ƒ ()
CodeDeploy: ƒ ()
CodePipeline: ƒ ()
CognitoIdentity: ƒ ()
CognitoIdentityCredentials: ƒ (e,t)
CognitoIdentityServiceProvider: ƒ ()
CognitoSync: ƒ ()
Comprehend: ƒ ()
ComprehendMedical: ƒ ()
Config: ƒ (e)
ConfigService: ƒ ()
CostExplorer: ƒ ()
CredentialProviderChain: ƒ (e)
Credentials: ƒ ()
DeviceFarm: ƒ ()
DirectConnect: ƒ ()
DynamoDB: ƒ ()
DynamoDBStreams: ƒ ()
EC2: ƒ ()
ECR: ƒ ()
ECS: ƒ ()
EFS: ƒ ()
ELB: ƒ ()
ELBv2: ƒ ()
EMR: ƒ ()
ElastiCache: ƒ ()
ElasticBeanstalk: ƒ ()
ElasticTranscoder: ƒ ()
Endpoint: ƒ (e,t)
EndpointCache: ƒ e(e)
EventListeners: {Core: constructor, CorePost: constructor, Logger: constructor, Json: constructor, Rest: constructor, …}
Firehose: ƒ ()
GameLift: ƒ ()
HttpClient: ƒ ()
HttpRequest: ƒ (e,t)
HttpResponse: ƒ ()
IAM: ƒ ()
Inspector: ƒ ()
Iot: ƒ ()
IotData: ƒ ()
JSON: {Builder: ƒ, Parser: ƒ}
KMS: ƒ ()
Kinesis: ƒ ()
KinesisVideo: ƒ ()
KinesisVideoArchivedMedia: ƒ ()
KinesisVideoMedia: ƒ ()
Lambda: ƒ ()
LexModelBuildingService: ƒ ()
LexRuntime: ƒ ()
MTurk: ƒ ()
MachineLearning: ƒ ()
MarketplaceCommerceAnalytics: ƒ ()
MediaStoreData: ƒ ()
MobileAnalytics: ƒ ()
Model: {Api: ƒ, Operation: ƒ, Shape: ƒ, Paginator: ƒ, ResourceWaiter: ƒ}
OpsWorks: ƒ ()
ParamValidator: ƒ (e)
Personalize: ƒ ()
PersonalizeEvents: ƒ ()
PersonalizeRuntime: ƒ ()
Polly: ƒ ()
Pricing: ƒ ()
Protocol: {Json: {…}, Query: {…}, Rest: {…}, RestJson: {…}, RestXml: {…}}
RDS: ƒ ()
Redshift: ƒ ()
Rekognition: ƒ ()
Request: ƒ (e,t,r)
ResourceGroups: ƒ ()
ResourceWaiter: ƒ (e,t)
Response: ƒ (e)
Route53: ƒ ()
Route53Domains: ƒ ()
S3: ƒ ()
SAMLCredentials: ƒ (e)
SES: ƒ ()
SNS: ƒ ()
SQS: ƒ ()
SSM: ƒ ()
STS: ƒ ()
SecretsManager: ƒ ()
SequentialExecutor: ƒ ()
Service: ƒ (e)
ServiceCatalog: ƒ ()
Signers: {RequestSigner: ƒ, V2: ƒ, V3: ƒ, V3Https: ƒ, V4: ƒ, …}
StorageGateway: ƒ ()
TemporaryCredentials: ƒ (e,t)
Translate: ƒ ()
VERSION: "2.487.0"
WAF: ƒ ()
WebIdentityCredentials: ƒ (e,t)
WorkDocs: ƒ ()
XHRClient: ƒ ()
XML: {Builder: ƒ, Parser: ƒ}
apiLoader: ƒ i(e,t)
有什么我想念的吗?还是有其他方法可以在浏览器中使用它?
任何帮助或方法将不胜感激。
答案 0 :(得分:0)
对于专门使用npm出现此问题的人,Textract类包含在“ aws-sdk / clients / textract”中
const Textract = require("aws-sdk/clients/textract");
(我知道这不完全是问题,但是当我搜索此问题时,此页面出现,希望我能够为使用npm的人回答此问题)