We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I searched for the problem and tried most solutions given without success.
I followed the documentation for installing Fastify with Typescript but I keep getting the type error.
{ "name": "fst", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "build": "tsc -p tsconfig.json", "start": "node ./dist/server.js", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { "fastify": "^5.2.1" }, "devDependencies": { "@tsconfig/node18": "^18.2.4", "@types/node": "^22.10.5", "typescript": "^5.7.2" } }
{ "extends": "@tsconfig/node18/tsconfig.json", "compilerOptions": { "outDir": "./dist", "lib": ["es2018"], "target": "es2018" } }
import fastify from 'fastify' const server = fastify() server.get('/ping', async (request, reply) => { return 'pong\n' }) server.listen({ port: 8080 }, (err, address) => { if (err) { console.error(err) process.exit(1) } console.log(`Server listening at ${address}`) }) server.listen({port: 3333})
Property 'get' does not exist on type 'FastifyInstance<Server<typeof IncomingMessage, typeof ServerResponse>, IncomingMessage, ServerResponse, FastifyBaseLogger, FastifyTypeProviderDefault> & PromiseLike<...> & { ...; }'.ts(2339)
To not show the error
I also tried inside Docker with node:23.1-bullseye and I get the same error.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
You have already researched for similar issues?
I searched for the problem and tried most solutions given without success.
What are you trying to achieve, or the steps to reproduce?
I followed the documentation for installing Fastify with Typescript but I keep getting the type error.
What was the result you received?
Property 'get' does not exist on type 'FastifyInstance<Server<typeof IncomingMessage, typeof ServerResponse>, IncomingMessage, ServerResponse, FastifyBaseLogger, FastifyTypeProviderDefault> & PromiseLike<...> & { ...; }'.ts(2339)
What did you expect?
To not show the error
Context
I also tried inside Docker with node:23.1-bullseye and I get the same error.
The text was updated successfully, but these errors were encountered: