Skip to content

Multiple TypeScript decorators mentioned in documentation produce TypeScript errors #122

Open
@quickdudley

Description

@quickdudley

When used exactly as described in the tutorial at https://www.graphiti.dev/js:

@Model() used as a class decorator produces this error:

TS1238: Unable to resolve signature of class decorator when used as expression. The runtime will invoke the decorator with 2 arguments, but the decorator expects 1

@Attr() used as a property decorator produces this error:

TS1240: Unable to resolve signature of property decorator when used as expression. Argument of type 'undefined' is not assignable to parameter of type 'Object'

@HasOne() used as a property decorator produces this error:

TS1240: Unable to resolve signature of property decorator when used as expression. Argument of type 'undefined' is not assignable to parameter of type 'SprayPaintBase'

Activity

quickdudley

quickdudley commented on Nov 1, 2024

@quickdudley
Author

As it turns out this is a documentation issue: the errors are resolved by adding "experimentalDecorators": true to my tsconfig.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @quickdudley

        Issue actions

          Multiple TypeScript decorators mentioned in documentation produce TypeScript errors · Issue #122 · graphiti-api/spraypaint.js