appsync: error destructuring within function signature in JS resolver runtime (TypeScript) #26355
Labels
@aws-cdk/aws-appsync
Related to AWS AppSync
bug
This issue is a bug.
response-requested
Waiting on additional info and feedback. Will move to "closing-soon" in 7 days.
Describe the bug
When using JS resolver pipelines with TS, I have encountered an unexpected error in my code.
If:
The deployment results in an error.
My tsconfig settings are identical to the ones recommended on https://docs.aws.amazon.com/appsync/latest/devguide/resolver-reference-overview-js.html#working-with-typescript but the transpiled js is still troublesome to the js runtime.
Expected Behavior
I expect the JS resolver code to deploy without errors.
Current Behavior
The deployment results in an error.
Reproduction Steps
And we call this function without providing the optional property:
The transpiled js file looks like this:
This is reproducible every time when the object parameter contains an optional property and at least one usage of this function does not provide the optional property.
Possible Solution
The error goes away if we destructure inside the function rather than the function signature:
Additional Information/Context
No response
CDK CLI Version
n/a
Framework Version
SST v2.8.27
Node.js Version
n/a
OS
mac
Language
Typescript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: