以下是我的 main.ts 片段
try {
process.on('unhandledRejection', (err) => {
// tslint:disable-next-line:no-console
console.error(err); <------- no console
});
const app = await NestFactory.create<NestFastifyApplication>(
AppModule,
new FastifyAdapter(),
);
app.enableCors();
app.useGlobalFilters(new AllExceptionsFilter());
await app.listen(3000, () => {
// tslint:disable-next-line:no-console
console.log('listen callback'); <------- no console
}).then(() => {
// tslint:disable-next-line:no-console
console.log('started'); <------- no console
});
} catch (error) {
// tslint:disable-next-line:no-console
console.log('catch', error); <----- only this gets consoled as undefined
}
我的应用程序连接到数据库(已验证),只是它没有启动。