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
[ ] Regression
[?] Bug report
[?] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
Current behavior
Using the "FastifyAdapter" the server fails to start with the message
UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'listeners' of undefined
Expected behavior
The server starts and the added health check URLs are available.
Minimal reproduction of the problem with instructions
App:
Basic setup of nest from the first-steps docs
index.ts with app = nestfactory.create() and app.listen,
app.module;
controllers: app.controller, which has a single @get(/hello) route
imports: HealthModule, that's the same as the one in the README, but DatabaseHealthIndicator replaced with DNSHealthIndicator which pings google
This start like expected: const app = await NestFactory.create(AppModule); await app.listen(20000);
This fails with the mentioned error: const app = await NestFactory.create(AppModule, new FastifyAdapter()); await app.listen(20000);
Note:
When using fastify/fastify with godaddy/terminus it works with this: createTerminus(fastify.server, options); (everything else is just copy/paste from their respective READMEs)
What is the motivation / use case for changing the behavior?
Nest provides FastifyAdapter by default, nestjs/terminus should be compatible with it.
Environment
Nest version: 5.5.1
For Tooling issues:
- Node version: 10.14.2
- Platform: Linux running docker, image: 10.14.2-alpine ; but also Linux running 10.13.0 directly
Others:
The text was updated successfully, but these errors were encountered:
Small note: Using createTerminus(app.getHttpAdapter().getHttpServer(), terminusOptions); will register the routes for the server (but not for nest, so it's kinda pointless, but at least more info for the maintainers).
getHttpServer() won't work as far as I know in a TestModuleContext. nestjs/nest#1282
Therefore I needed to change to ApplicationReferenceHost.
Seems like ApplicationReferenceHost provided by @nestjs/core does not provide a HttpServer when using Fastify.
I was able to reproduce the error by adding a FastifyAdapter e2e test case.
Travis fails with: Cannot read property 'listeners' of undefined, therefore ApplicationReferenceHost.applicationRef.httpServer must be null
I'm submitting a...
Current behavior
Using the "FastifyAdapter" the server fails to start with the message
Expected behavior
The server starts and the added health check URLs are available.
Minimal reproduction of the problem with instructions
App:
This start like expected:
const app = await NestFactory.create(AppModule); await app.listen(20000);
This fails with the mentioned error:
const app = await NestFactory.create(AppModule, new FastifyAdapter()); await app.listen(20000);
Note:
createTerminus(fastify.server, options);
(everything else is just copy/paste from their respective READMEs)What is the motivation / use case for changing the behavior?
Nest provides FastifyAdapter by default, nestjs/terminus should be compatible with it.
Environment
The text was updated successfully, but these errors were encountered: