When I run this code:
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import cookieParser from 'cookie-parser';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.use(cookieParser());
await app.listen(3000);
}
bootstrap();
I get:
(node:28) UnhandledPromiseRejectionWarning: TypeError: cookie_parser_1.default is not a function
at bootstrap (/usr/src/app/dist/main.js:8:36)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
If I comment out "app.use(cookieParser());" the problem goes away, but I need the cookie parser.