# Typescript template cannot resolve aws-sdk modules

**URL:** <https://forum.serverless.com/t/typescript-template-cannot-resolve-aws-sdk-modules/11942>\
**Category:** Serverless Framework\
**Tags:** aws, lambda, dynamodb\
**Created:** [July 6, 2020, 3:22pm UTC](https://forum.serverless.com/t/typescript-template-cannot-resolve-aws-sdk-modules/11942 "2020-07-06T15:22:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jWang1](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/jwang1/32/4385_2.png) [@jWang1](https://forum.serverless.com/u/jWang1)\
**Post date:** [July 6, 2020, 3:22pm UTC](https://forum.serverless.com/t/typescript-template-cannot-resolve-aws-sdk-modules/11942/1 "2020-07-06T15:22:55Z")

</div>

I am using the aws-nodejs-typescript template. Everything works fine but when I try to import aws-sdk I get 3 Module not found errors.

```
import { failure, success } from '../../../libs/response';

import { APIGatewayProxyHandler } from 'aws-lambda';

import { DynamoDB } from 'aws-sdk';

const dynamoDb = new DynamoDB.DocumentClient();

export const handler: APIGatewayProxyHandler = async () => {

  try {

    const params = {

      TableName: 'My_Table',

      Key: {

        pk: 'variable',

        sk: 'variable'

      }

    };

    const result = await dynamoDb.query(params).promise();

    return success(result);

  } catch (e) {

    return failure();

  }

};

ERROR in ...../node_modules/aws-sdk/lib/aws.js
Module not found: Error: Can't resolve '../clients/all' in '.....\node_modules\aws-sdk\lib'
 @ ...../node_modules/aws-sdk/lib/aws.js 6:0-25
 @ ./functions/get-pending-validation-products.ts

ERROR in .....//node_modules/aws-sdk/lib/aws.js
Module not found: Error: Can't resolve './core' in '.....\node_modules\aws-sdk\lib'
 @ C:/Monkey Minds/Repositories/3dNinjas/3d-ninjas-ext-api/node_modules/aws-sdk/lib/aws.js 3:10-27
 @ ./functions/get-pending-validation-products.ts

ERROR in ...../node_modules/aws-sdk/lib/aws.js
Module not found: Error: Can't resolve './node_loader' in '.....\node_modules\aws-sdk\lib'
 @ ...../node_modules/aws-sdk/lib/aws.js 1:0-24
 @ ./functions/get-pending-validation-products.ts

```

Are types missing? Types are already included in aws-sdk so I don’t need to install @types/aws-sdk.

When I browse my node\_modules folder everything is there including types.

---

<div class="post-metadata">

**Author:** ![juuyan](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.serverless.com/juuyan/32/4466_2.png) [@juuyan](https://forum.serverless.com/u/juuyan)\
**Post date:** [August 6, 2020, 5:47am UTC](https://forum.serverless.com/t/typescript-template-cannot-resolve-aws-sdk-modules/11942/2 "2020-08-06T05:47:03Z")

</div>

The problem is in the webpack config. Add .js into the resolve.extensions array.

```
resolve: { extensions: ['.mjs', '.json', '.ts'] }
```
