Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Nest.js @nestjs/platform-fastify,NestFastifyApplication<RawServerDefault>' does not satisfy the constraint 'INestApplication'

I’m using Nest.js, and I change express to fastify,but I got this error, NestFastifyApplication’ does not satisfy the constraint ‘INestApplication’, I tried to uninstall @nestjs/platform-fastify, then install again, but still got this error,

this my code:

import { NestFactory } from '@nestjs/core';
import {
  FastifyAdapter,
  NestFastifyApplication,
} from '@nestjs/platform-fastify';
import { AppModule } from './app.module';

async function bootstrap() {
  const app = await NestFactory.create<NestFastifyApplication>(
    AppModule,
    new FastifyAdapter(),
  );
  await app.listen(3000);
}
bootstrap();

I run nest info:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

[Nest Platform Information]
platform-fastify version : 10.0.3
mapped-types version     : 2.0.2
schematics version       : 9.2.0
testing version          : 9.4.3
common version           : 9.4.3
core version             : 9.4.3
cli version              : 9.5.0

I don’t know how to solve this error.

>Solution :

common, core, platform-fastify, and testing should all be on the same version. schematics and cli should be on the same major version. That should fix your issue

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading