2

I'm using APIGW Generated SDK for javascript, and I have sourced all the files and get no errors there, but I get an error on this line: var apigClient = apigClientFactory.newClient();

which makes sense, because I don't see any sources that point to anything called "apigClientFactory", nor are there any instructions on instantiating anything called "apigClientFactory" as an object/variable or anything, so I'm confused as to what this is supposed to be referencing?

The instructions Aws amazon docs start with this and never reference where this factory component is from, hence the error...

1
  • The apigClientFactory should be generated by API Gateway for your API. You can read the code in apiClient.js file Commented Dec 5, 2017 at 21:47

2 Answers 2

3

I just found out on a call with AWS support that the SDK generator tool doesn't currently know how to handle ANY methods in your API and will ignore them.

Therefore, if you generate an API with only ANY methods (and no specific GET / POST / etc), the SDK generator tool will not include the apiClient.js file that includes the apigClientFactory you need and you will receive the apigClientFactory not defined error you mention above.

Sign up to request clarification or add additional context in comments.

1 Comment

This explanation is mentioned in the AWS doc but What is the solution for that?
2

You can include this

var apigClientFactory = require('aws-api-gateway-client').default; 

1 Comment

what is the '.default' for?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.