-
Notifications
You must be signed in to change notification settings - Fork 14
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: Property 'urlData' does not exist on type 'FastifyRequest'. #2
Comments
I really don't know what you want me to do with this. |
@jsumners sorry I should be more clear, updated |
I understood what was happening. I just literally have no idea what you want me to do about it. This is a plugin. Therefore it isn't a part of the TS stuff in the core framework. |
@jsumners me neither. At a user's point of view, I'm starting my project with TypeScript + fastify, which works well, then I included this plugin, it stopped working, and there is no easy way to fix it. I think there should be some mechanism in |
cc: @fastify/fastify This is why the TS things really don't belong in core. Unless you know of a fix @evanshortiss, the way I see it, the TS descriptions are just going to cause these sorts of problems. They should be something the user deliberately adds to their project. |
Agree with @jsumners |
I do not know exactly how to fix this and if typescript definitions can allow the level of usage that we need. |
I think we should try to keep the TS definitions in, as they encourage more users to try our framework. |
No matter where the TS definitions is, there should be a way to solve this problem |
I've opened #4 as an example of how this can be addressed - it should use Similar to core, it could be supported here or via DefinitelyTyped.
Not sure I understand. The problem is the same regardless of where the Ideally folks who want to use TypeScript can open this kind of PR for plugins when required. Moving them to DefinitelyTyped might reduce noise if that is what is preferred? Folks will still open these kinds of issues though. I suppose if we don't support it then at least it can be closed with reasoning such as "typescript support is handled outside of the fastify org". |
I should point out, this comment is not meant to berate people who do not contribute. We all have many commitments in this life and time is not always available 👍 |
^ that would be fine by me. The way I see it, people using Typescript are causing their own headaches. I don't need that headache propagated to me. |
@jsumners it's a very short lived headache for an ultimately stronger codebase - in larger applications anyway. I've seen your disdain for TS repeatedly so I'm not going to bother preaching it's benefits to you! 😂 For small plugins like this it's should be fairly simple to CC someone on to take a look at the |
In my route:
TypeScript would complain:
src/app.ts(55,26): error TS2339: Property 'urlData' does not exist on type 'FastifyRequest'.
because there is no attribute
urlData
onFastifyRequest
: https://github.com/fastify/fastify/blob/master/fastify.d.ts#L22The text was updated successfully, but these errors were encountered: