Version: latest (v5.8.x)
Table of contents
Warnings
Warnings In Fastify
Fastify uses Node.js's warning event API to notify users of deprecated features and coding mistakes. Fastify's warnings are recognizable by the FSTWRN and FSTDEP prefixes. When encountering such a warning, it is highly recommended to determine the cause using the --trace-warnings and --trace-deprecation flags. These produce stack traces pointing to where the issue occurs in the application's code. Issues opened about warnings without this information will be closed due to lack of details.
Warnings can also be disabled, though it is not recommended. If necessary, use one of the following methods:
- Set the
NODE_NO_WARNINGSenvironment variable to1 - Pass the
--no-warningsflag to the node process - Set
no-warningsin theNODE_OPTIONSenvironment variable
For more information on disabling warnings, see Node's documentation.
Disabling warnings may cause issues when upgrading Fastify versions. Only experienced users should consider disabling warnings.
Fastify Warning Codes
Code
Description
How to solve
Discussion
FSTWRN001
The specified schema for a route is missing. This may indicate the schema is not well specified.
Check the schema for the route.
FSTWRN002
The %s plugin being registered mixes async and callback styles, which will result in an error in fastify@5.
Do not mix async and callback style.
Fastify Deprecation Codes
Deprecation codes are supported by the Node.js CLI options:
Code
Description
How to solve
Discussion
FSTDEP022
You are trying to access the deprecated router options on top option properties.
Use options.routerOptions.