Closed vinkaga closed 4 years ago
If you are using JavaScript instead of Typescript for development then you shouldn't have generics in your code anywhere. This is a working main.js
file for Fastify on Linux Mint 19.1 with Node 13.7.
import { NestFactory } from '@nestjs/core';
import { FastifyAdapter } from '@nestjs/platform-fastify';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await NestFactory.create(AppModule, new FastifyAdapter());
await app.listen(3000);
}
bootstrap();
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Bug Report
Created JS sample from cli. Ran
npm run start
, runs correctly. Modified for Fastify by changingmain.js
as shown below. Then run fails with errorTypeError: app.listen is not a function
.Current behavior
Main.js after modification
Expected behavior
~/d/n/s/10-fastify (master|✔) $ npm run start
[Nest] 97785 - 02/19/2020, 4:21:26 PM [NestFactory] Starting Nest application... [Nest] 97785 - 02/19/2020, 4:21:26 PM [InstanceLoader] AppModule dependencies initialized +15ms [Nest] 97785 - 02/19/2020, 4:21:26 PM [InstanceLoader] CoreModule dependencies initialized +1ms [Nest] 97785 - 02/19/2020, 4:21:26 PM [InstanceLoader] CatsModule dependencies initialized +0ms [Nest] 97785 - 02/19/2020, 4:21:26 PM [RoutesResolver] CatsController {/cats}: +14ms [Nest] 97785 - 02/19/2020, 4:21:26 PM [RouterExplorer] Mapped {/, POST} route +4ms [Nest] 97785 - 02/19/2020, 4:21:26 PM [RouterExplorer] Mapped {/, GET} route +1ms [Nest] 97785 - 02/19/2020, 4:21:26 PM [RouterExplorer] Mapped {/:id, GET} route +1ms [Nest] 97785 - 02/19/2020, 4:21:26 PM [NestApplication] Nest application successfully started +3ms
Environment