Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Computed property in object literal gives 'unable to extract property' error #911

Open
dmeehan1968 opened this issue Oct 26, 2023 · 0 comments

Comments

@dmeehan1968
Copy link

dmeehan1968 commented Oct 26, 2023

const TableName = asl.deploy.getParameter('MigrationTableName')

await asl.sdk(DynamoDB).batchWriteItem({
    parameters: {
        RequestItems: {
            [TableName]: migratedItems.map(item => ({
                PutRequest: {
                    Item: item,
                }
            }))
        }
    }
})

It doesn't matter if the parameter is first copied to TableName or used directly, it only seems to support the TableName property being a string literal (['string value'] also fails).

This essentially prevents use of an API such as batchWriteItem where the properties are table names, and thus need to be passed in as properties.

Error is (note the lack of context):

    Error: unable to extract property name for property assignment

    Kind: ObjectLiteralExpression
    Source: ??
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant