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

Method parameter decorators cause typescript build to fail. #2137

Open
IhsanMujdeci opened this issue Nov 9, 2023 · 0 comments
Open

Method parameter decorators cause typescript build to fail. #2137

IhsanMujdeci opened this issue Nov 9, 2023 · 0 comments

Comments

@IhsanMujdeci
Copy link

IhsanMujdeci commented Nov 9, 2023

Describe the bug
Not sure if this is a bug or intended.
The body function and other parameter functions aren't actually functions that typescript can build.
Other decorators seem to be fine and actually build and resolve to a value e.g. class decorators and method decorators.

To Reproduce
Steps to reproduce the behavior:

  1. npx @airtasker/spot init
  2. npx tsx ./api.ts
  3. Console error TypeError: decorator is not a function (it seems to error on the first instance of use of the @body decorator).

This error also appears while using SWC, I haven't tired TSC.

Expected behavior
I would expect that typescript would be able to build the solution but it seems it cant.
The @body and other method parameter decorators don't resolve to a real value, they are "undefined"
Actual building of API docs works fine via npx @airtasker/spot generate --contract api.ts

Screenshots
image

Desktop (please complete the following information):

  • OS: Macbbok M1 Pro 14.1 (23B74)
  • Yarn version v1.22.19
  • v18.18.2
  • Spot version: 1.12.0

Additional context
Please respond with if this is expected behaviour or a bug with how I'm using the library.

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