You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
won't compile with TypeScript because of the following error:
error TS2339: Property 'urlData' does not exist on type 'FastifyRequest<RouteGenericInterface, RawServerDefault, IncomingMessage, FastifySchema, FastifyTypeProviderDefault, unknown, FastifyBaseLogger, ResolveFastifyRequestType<...>>
I have seen in the source-code and the issues (#2 (comment)), that this plugin is enhancing the FastifyRequest-interface with the urlData-property.
However, I can not make it to work somehow.
What is the correct approach, to use TypeScript and make urlData available in FastifyRequest interface?
The text was updated successfully, but these errors were encountered:
Can you provide steps to reproduce? We often need a reproducible example, e.g. some code that allows someone else to recreate your problem by just copying and pasting it. If it involves more than a couple of different file, create a new repository on GitHub and add a link to that.
I guess, because you would actually need to import the fastify-url-data package into your separate file, where you use FastifyRequest, so that typescript can hoist the additional typings.
Prerequisites
Issue
Writing code with types like
won't compile with TypeScript because of the following error:
When I remove the type
FastifyRequest
, it works:I have seen in the source-code and the issues (#2 (comment)), that this plugin is enhancing the
FastifyRequest
-interface with theurlData
-property.However, I can not make it to work somehow.
What is the correct approach, to use TypeScript and make
urlData
available inFastifyRequest
interface?The text was updated successfully, but these errors were encountered: