Skip to content

Does it work with function metadata? #18

@bakura10

Description

@bakura10

Hi :),

I am using this plugin with serverless-esbuild to add support for decorator metadata, but I am hitting a block road and I am unsure if this is related to this or something else.

I am using it with MikroORM, which accepts properties that are functions:

@ManyToOne({entity: () => RelatedEntity, mappedBy: 'foo'})

MikroORM also supports setting string properties, which works:

@ManyToOne({entity: 'RelatedEntity', mappedBy: 'foo'})

But I would prefer using the function one, as it helps TypeScript to figure out the entity properties.

When ESBuild attempts to read the data from a function attribute, it raises errors like this:

✖ Cannot read properties of undefined (reading 'name')

I wonder if this is a limitation of this plugin that only support scalar values, or if this is completely unrelated :).

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions