Open paulius-valiunas opened 3 months ago
same problem
it's Fastify()
not fastify()
it's
Fastify()
notfastify()
If you import it as import * as Fastify from "fastify"
or import Fastify from "fastify"
, you're right.
If you import it as import * as fastify from "fastify"
or import fastify from "fastify"
, it's fastify()
.
If you import it as import * as cthulhu from "fastify"
or import cthulhu from "fastify"
, it's cthulhu()
.
Prerequisites
Fastify version
4.28.1
Plugin version
3.6.0
Node.js version
20.15.0
Typescript version
5.2.2 (also tested with 5.5.4)
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
archlinux in WSL
Description
I tried following Fastify documentation, but even when copy/pasting their example without any changes, the inferred type of
request.query
isunknown
.MRE:
Link to code that reproduces the bug
No response
Expected Behavior
request.query
should be correctly inferred to be of type{ foo: string, bar: string }
. Same problem withbody
,response
,headers
andparams
types.