But TypeScript definitely doesn't like adding additional fields. Right now I'm working on TypeScript, added the new Fastify raw body plugin, and forgot to extend our custom Request type. The error is:
Property 'rawBody' does not exist on type 'CustomRequest<DefaultQuery, DefaultParams, DefaultHeaders, any>'.ts(2339)
Ie, we can't just add a field.
Appreciate I may be wrong, or we have different definitions here, but I'd like to discuss.
I understand 'incorrect values' (this is true, see https://github.com/Microsoft/TypeScript/issues/15480) .
But TypeScript definitely doesn't like adding additional fields. Right now I'm working on TypeScript, added the new Fastify raw body plugin, and forgot to extend our custom Request type. The error is:
Ie, we can't just add a field.Appreciate I may be wrong, or we have different definitions here, but I'd like to discuss.