aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
3.11k stars 578 forks source link

Property '$metadata' does not exist on type 'StartExecutionCommandOutput'. #4906

Closed blindperson closed 10 months ago

blindperson commented 1 year ago

Checkboxes for prior research

Describe the bug

After upgrading from version 3.359.0 to 3.363.0, packaging errors were reported error TS2339: Property '$metadata' does not exist on type 'StartExecutionCommandOutput'.

SDK version number

@aws-sdk/client-sfn@3.363.0,@aws-sdk/client-lambda@3.363.0,

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v14.18.3

Reproduction Steps

After upgrading from version 3.359.0 to 3.363.0, packaging errors were reported error TS2339: Property '$metadata' does not exist on type 'StartExecutionCommandOutput'.

Observed Behavior

Compiling typescript...

command-forward-v1/test/commandForward.spec.ts(83,7): error TS2322: Type '{ StatusCode: number; $metadata: { httpStatusCode: number; }; }' is not assignable to type 'InvokeCommandOutput'.
  Object literal may only specify known properties, and '$metadata' does not exist in type 'InvokeCommandOutput'.
command-forward-v1/test/commandForward.spec.ts(148,7): error TS2322: Type '{ StatusCode: number; $metadata: {}; }' is not assignable to type 'InvokeCommandOutput'.
  Object literal may only specify known properties, and '$metadata' does not exist in type 'InvokeCommandOutput'.
command-forward-v1/test/commandForward.spec.ts(239,7): error TS2322: Type '{ StatusCode: number; $metadata: {}; }' is not assignable to type 'InvokeCommandOutput'.
  Object literal may only specify known properties, and '$metadata' does not exist in type 'InvokeCommandOutput'.
delete-repository-v4/src/utils/callStepFunction.ts(36,21): error TS2339: Property '$metadata' does not exist on type 'StartExecutionCommandOutput'.

Expected Behavior

npm run build successfully

Possible Solution

No response

Additional Information/Context

No response

aldirrix commented 1 year ago

We are experiencing the same with the DynamoDB client

Property '$metadata' does not exist on type 'DeleteItemCommandOutput'.

RanVaknin commented 1 year ago

Hi @blindperson and @aldirrix ,

Can either of you please post some reproduction steps and code that can help us raise the same errors?

Thanks, Ran~

blindperson commented 1 year ago

hi @RanVaknin I just uploaded a simple demo to GitHub, please help review, thanks: https://github.com/blindperson/aws-sdk-V3.363-test

blindperson commented 1 year ago

and after executing npm i && npm run build, i can get same error


[tsl] ERROR in C:\Users\t_xuez\Desktop\code\aws-sdk-V3.363-test\index.ts(19,21)
      TS2339: Property '$metadata' does not exist on type 'StartExecutionCommandOutput'.`
blindperson commented 1 year ago

hi @RanVaknin and aws team, do you have any update? thanks

bossyan commented 11 months ago

Any updates?

RanVaknin commented 11 months ago

Hi there,

I apologize for the long response time, this fell off my radar.

I cloned the repo provided by @blindperson but I'm not running into an issue transpiling.

After running npm install:

$ tsc index.ts
$ node index.js
Step function invoked: arn = arn:aws:states:us-east-1:REDACTED:stateMachine:SimpleStateMachine, params = {"exampleKey":"exampleValue"}, response = {"$metadata":{"httpStatusCode":200,"requestId":"REDACTED","attempts":1,"totalRetryDelay":0},"executionArn":"arn:aws:states:us-east-1:REDACTED:execution:SimpleStateMachine:REDACTED","startDate":"2023-12-04T09:13:40.907Z"}

Can you delete your node_modules, and pakcage-lock.json and then run npm install again?

Thanks, Ran~

github-actions[bot] commented 10 months ago

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

github-actions[bot] commented 10 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.