You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing issues to ensure the bug has not already been reported
Fastify version
3.24.0
Plugin version
0.3.3
Node.js version
14.17.6
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
11.6
Description
When I run npm run start on minimal example with nest.js and fastify-express, I have following:
antonmalmygin@Antons-MBP project-name % npm run start
> project-name@0.0.1 start
> nest start
[Nest] 10969 - 11/30/2021, 12:59:26 PM LOG [NestFactory] Starting Nest application...
[Nest] 10969 - 11/30/2021, 12:59:26 PM LOG [InstanceLoader] AppModule dependencies initialized +18ms
(node:10969) UnhandledPromiseRejectionWarning: FastifyError: The decorator 'use' has already been added!
at decorate (/Users/antonmalmygin/Desktop/Dev/another/nest-example/project-name/node_modules/fastify/lib/decorate.js:22:11)
at Object.decorateFastify [as decorate] (/Users/antonmalmygin/Desktop/Dev/another/nest-example/project-name/node_modules/fastify/lib/decorate.js:65:3)
at expressPlugin (/Users/antonmalmygin/Desktop/Dev/another/nest-example/project-name/node_modules/fastify-express/index.js:9:11)
at Plugin.exec (/Users/antonmalmygin/Desktop/Dev/another/nest-example/project-name/node_modules/avvio/plugin.js:132:19)
at Boot.loadPlugin (/Users/antonmalmygin/Desktop/Dev/another/nest-example/project-name/node_modules/avvio/plugin.js:267:10)
at release (/Users/antonmalmygin/Desktop/Dev/another/nest-example/project-name/node_modules/fastq/queue.js:149:16)
at Object.resume (/Users/antonmalmygin/Desktop/Dev/another/nest-example/project-name/node_modules/fastq/queue.js:82:7)
at setup (/Users/antonmalmygin/Desktop/Dev/another/nest-example/project-name/node_modules/avvio/plugin.js:164:12)
at Plugin.loadedSoFar (/Users/antonmalmygin/Desktop/Dev/another/nest-example/project-name/node_modules/avvio/plugin.js:176:7)
at Boot._loadRegistered (/Users/antonmalmygin/Desktop/Dev/another/nest-example/project-name/node_modules/avvio/boot.js:227:17)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:10969) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:10969) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:10969) UnhandledPromiseRejectionWarning: Error: ERR_AVVIO_PLUGIN_TIMEOUT: plugin did not start in time: /Users/antonmalmygin/Desktop/Dev/another/nest-example/project-name/node_modules/fastify-express/index.js. You may have forgotten to call 'done' function or to resolve a Promise
at Timeout._onTimeout (/Users/antonmalmygin/Desktop/Dev/another/nest-example/project-name/node_modules/avvio/plugin.js:123:19)
at listOnTimeout (internal/timers.js:557:17)
at processTimers (internal/timers.js:500:7)
(node:10969) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
I saw similar issue being reported here #36, but changing Fastify version doesn't solved the issue for me (and also I use Nest.js).
Prerequisites
Fastify version
3.24.0
Plugin version
0.3.3
Node.js version
14.17.6
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
11.6
Description
When I run
npm run start
on minimal example with nest.js and fastify-express, I have following:I saw similar issue being reported here #36, but changing Fastify version doesn't solved the issue for me (and also I use Nest.js).
Steps to Reproduce
I created a minimal example to reproduce here https://github.com/amOgury/nestjs-fastify-express-example
It's identical to Nest.js example with Fastify from here https://docs.nestjs.com/techniques/performance, except that I register
fastify-express
here https://github.com/amOgury/nestjs-fastify-express-example/blob/main/src/main.ts#L13Expected Behavior
Minimal example should start normally
The text was updated successfully, but these errors were encountered: