-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[FSTDEP004] FastifyDeprecation #3284
Comments
I cannot reproduce your problem. |
Hey @climba03003 check this code for the import fastify from 'fastify';
const server = fastify();
server.register(async(app) => {
app.addHook('preParsing', async(req, rep,pay) => {
console.log('here from "preParsing" hook')
return pay;
})
app.get('/warning', async(req, rep) => {
return {
hello: "hola"
}
})
})
server.listen(3000) and this is {
"dependencies": {
"fastify": "^3.20.2",
"fastify-plugin": "^3.0.0",
"fastify-sequelize": "^1.0.4",
"mysql2": "^2.3.0",
"pino-pretty": "^6.0.0"
},
"devDependencies": {
"@tsconfig/node12": "^1.0.9",
"@types/node": "^16.7.1",
"nodemon": "^2.0.12",
"ts-node": "^10.2.1",
"typescript": "^4.3.5"
},
"scripts": {
"dev": "nodemon src/server.ts",
"build": "tsc -p tsconfig.json"
}
} Note: This warning printted when i use fastify with ts-node and typescript |
@siemah |
@climba03003 |
It should be the TypeScript transpile problem. We test the function against Change the target greater than |
@climba03003 |
@siemah Feel free to send a PR for the documentation improvement. |
Prerequisites
Fastify version
3.20.2
Plugin version
3.0.0
Node.js version
12.22.3
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
10.15.7
Description
I tried to call
preParsing
hook using the async way as suggested in the documentation:and when i take a look at my terminal i found this warning:
(node:37541) [FSTDEP004] FastifyDeprecation: You are using the legacy preParsing hook signature. Use the one suggested in the documentation instead. server listening on http://[::1]:4321
then i tried the other way:
i didnt find any warning.
Steps to Reproduce
preParsing
hook using the code aboveExpected Behavior
No response
The text was updated successfully, but these errors were encountered: