`
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify';
import { join } from 'path';
import { RenderService } from 'nest-next';
import * as passport from 'passport';
import fastifySession from 'fastify-session';
import secureSession from '@fastify/secure-session';
async function bootstrap() {
Is there an existing issue for this?
Current behavior
I setup a project with the main.js as below,
` import { NestFactory } from '@nestjs/core'; import { AppModule } from './app.module'; import { FastifyAdapter, NestFastifyApplication } from '@nestjs/platform-fastify'; import { join } from 'path'; import { RenderService } from 'nest-next'; import * as passport from 'passport'; import fastifySession from 'fastify-session'; import secureSession from '@fastify/secure-session'; async function bootstrap() {
const app = await NestFactory.create(
AppModule,
new FastifyAdapter(),
);
await app.register(secureSession, {
secret: 'averylogphrasebiggerthanthirtytwochars',
salt: 'mq9hDxBVDbspDR6n',
});
app.setGlobalPrefix(
/absproxy/5000
);await app.listen(5000);
} bootstrap();
`
it will report unhandledRejection: TypeError: Cannot read properties of undefined (reading 'bind')
If I change to below, taking out the adapter param, it works: ` const app = await NestFactory.create(
AppModule
);
`
Minimum reproduction code
https://github.com/raychunghk/NxTime/blob/main/src/server/main.ts
Steps to reproduce
No response
Expected behavior
It should work by just copy/paste from the official documentation. `import secureSession from '@fastify/secure-session';
// somewhere in your initialization file const app = await NestFactory.create(
AppModule,
new FastifyAdapter(),
);
await app.register(secureSession, {
secret: 'averylogphrasebiggerthanthirtytwochars',
salt: 'mq9hDxBVDbspDR6n',
});`
Package
Other package
No response
NestJS version
10.0.0
Packages versions
Node.js version
No response
In which operating systems have you tested?
Other
No response