lib-dynamodb's smithy-client is (incorrectly) a devDependency
envgap__aws__aws-sdk-js-v3-5518
01 / FAILURE SIGNATURE
As reported upstream
No identifying execution failure has been captured.
Not a benchmark task.
- In a clean container the reported failure did not reproduce, or the known fix did not make the project run.
02 / ENVIRONMENT RECIPE
- Base commit
b4b0be4fe84b5f33086b05531ee841279c7dc33d- Manifest
lib/lib-dynamodb/package.json- Reproduce
Awaiting issue-specific recipe- Run under trace
Awaiting a meaningful runtime command
03 / ORIGINAL ISSUE TEXT
aws/aws-sdk-js-v3 #5518 · read the original issue
### Checkboxes for prior research
- [X] I've gone through [Developer Guide](https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide) and [API reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest)
- [X] I've checked [AWS Forums](https://forums.aws.amazon.com) and [StackOverflow](https://stackoverflow.com/questions/tagged/aws-sdk-js).
- [X] I've searched for [previous similar issues](https://github.com/aws/aws-sdk-js-v3/issues) and didn't find any solution.
### Describe the bug
I believe this is similar to https://github.com/aws/aws-sdk-js-v3/issues/3595 and https://github.com/aws/aws-sdk-js-v3/issues/3626.
lib-dynamodb lists smithy-client as its devDependency:
https://github.com/aws/aws-sdk-js-v3/blob/5787687f0fc226ec49a22172ddc658d31a3d53c9/lib/lib-dynamodb/package.json#L37
but actually requires it at runtime, DynamoDBDocumentClient extends the smithy Client:
https://github.com/aws/aws-sdk-js-v3/blob/5787687f0fc226ec49a22172ddc658d31a3d53c9/lib/lib-dynamodb/src/DynamoDBDocumentClient.ts#L9
https://github.com/aws/aws-sdk-js-v3/blob/5787687f0fc226ec49a22172ddc658d31a3d53c9/lib/lib-dynamodb/src/DynamoDBDocumentClient.ts#L134
The specific manifestation of this that I'm running into is: when using Yarn PnP and TypeScript, type-checking fails with
> Property 'send' does not exist on type 'DynamoDBDocumentClient'
because `send` comes from the smithy Client. Minimal repro:
https://github.com/heypiotr/yarnpnp-aws-sdk-lib-dynamodb
### SDK version number
@aws-sdk/lib-dynamodb@3.454.0
### Which JavaScript Runtime is this issue in?
Node.js
### Details of the browser/Node.js/ReactNative version
v18.18.2
### Reproduction Steps
Repo: https://github.com/heypiotr/yarnpnp-aws-sdk-lib-dynamodb
How to re-create it:
```shell
mkdir repro && cd repro
yarn init -2
yarn add @aws-sdk/lib-dynamodb @aws-sdk/client-dynamodb typescript
yarn tsc --init -m nodenext -t esnext
echo 'import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient, GetCommand } from "@aws-sdk/lib-dynamodb";
const ddbClient = new DynamoDBClient({});
const ddbDocClient = DynamoDBDocumentClient.from(ddbClient);
const { Item } = await ddbDocClient.send(
new GetCommand({
TableName: "foo",
Key: { PK: "foo" },
})
);
' > index.mts
yarn tsc --noEmit
```
### Observed Behavior
TypeScript compilation fails with
> Property 'send' does not exist on type 'DynamoDBDocumentClient'
### Expected Behavior
TypeScript compilation succeeds
### Possible Solution
I think moving smithy-client to `dependencies` should fix this
### Additional Information/Context
_No response_04 / LABELS
Labels from the report text only; not yet run
No supported category has been assigned.
Label rules and the text that matched
[]