2

I'm creating a webpage that has this javascript code.

let AWS = require("aws-sdk");
AWS.config.region = AWS_REGION;
AWS.config.credentials = new AWS.CognitoIdentityCredentials({
  IdentityPoolId: COGNITO_IDENTITY_POOL_ID
});
let ddb = new AWS.DynamoDB();
let swf = new AWS.SWF();

Same code is working as a standalone javascript file executed with node command. But when I include it in a javascript in a project that has aws-sdk as a node dependency, I'm getting error Uncaught TypeError: AWS.SWF is not a constructor

However, It can find other AWS services without any issues. The ddb object is being initialised without any issues. Can anyone tell me what is going wrong, why only SWF has issue in getting initialized?

It is a project created using webpack, vue-cli just to give some context.

Buddha
  • 4,339
  • 2
  • 27
  • 51

0 Answers0