-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
TypeScript error "Unable to resolve signature of parameter decorator when called as an expression" #1667
Comments
What version of TypeScript? |
@willsoto , |
4.3.5 is a very old version of TypeScript though. You should try upgrading and, if it's still broken, creating a minimal reproduction or a failing test case. |
Try reloading VSCode? |
tried already, didn't help though. Weird thing... |
Perhaps VSCode isn't using whatever |
Looks like the plugin |
👍 |
With typescript v5 it fails with the same error when trying to build. |
Please confirm it's not the same issue with the same resolution mentioned here: #1667 (comment) If you believe it's actually an issue with v5, please open a new issue with a minimal reproduction of the problem. |
I have the same problem. This reproduces the problem. I have also fixed the problem and I am making a pull request for it right now. |
I found this issue #1667 that had the same errors as me, but the comments didn't help. I also found a different issue nestjs/nest#10959, and the fix they used nestjs/nest#10970, and used that to fix the problem with the InjectMetric decorator. The problem is that the decorator types are wrong. Record<string, unknown> fails with strict checks, and the key may also be undefined. Fixes #1667
🎉 This issue has been resolved in version 5.1.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
On the sample code:
TS compiler throws an error:
The text was updated successfully, but these errors were encountered: