Hey there, anyone have an idea whyu i get `res.set...
# support-questions-legacy
t
Hey there, anyone have an idea whyu i get
res.setHeader is not a function
with NestJS + fastify; Look like the function error come from
Session.getSession
calling
setCookie
with express framework instead of fastify.
Copy code
import { Injectable } from '@nestjs/common';
import { HttpAdapterHost } from '@nestjs/core';
import { FastifyAdapter } from '@nestjs/platform-fastify';
import { plugin } from 'supertokens-node/framework/fastify';

@Injectable()
export class SupertokensFastify {
  constructor(private readonly adapterHost: HttpAdapterHost) {
    const httpAdapter = adapterHost.httpAdapter as FastifyAdapter;
    if (!httpAdapter) return;
    httpAdapter.getInstance().register(plugin);
  }
}
I register the plugin like this
r
hey @Totomakers whats the supertokens.init look like on the backend?
t
Copy code
EmailVerification.init({
          mode: 'REQUIRED',
        }),
        Session.init(),
        Dashboard.init(),
        ThirdPartyEmailPassword.init({
});
(i have omit some part of ThierPartyEmailPassword)
r
can i see the full supertokens.init? have you set the framework prop in supertokens.init?
t
Oh god nop 😢
That sure the issue
Perfect that was my problem, sorry for that 😢
thanks for the help ❤️ ❤️
r
happy to help!
4 Views