Skip to content

[FSTDEP004] FastifyDeprecation #3284

@siemah

Description

@siemah

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure it has not already been reported

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:

fastify.addHook('preParsing', async (request, reply, payload) => {
  // Some code
  return payload;
})

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:

fastify.addHook('preParsing',  (request, reply, payload, done) => {
  // Some code
  return done(null, payload);
})

i didnt find any warning.

Steps to Reproduce

  • Create a fastify server
  • Add preParsing hook using the code above

Expected Behavior

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    typescriptTypeScript relatedwontfixThis will not be worked on, the behavior is intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions