#Incompatibility when using TypeORM with NestJS 10

2 messages · Page 1 of 1 (latest)

cloud kelp
#

I'm trying to integrate NestJS 10 with TypeORM, but keep getting runtime errors that seem to indicate an incompatibility.

I create a new Nest application with NestJS CLI (v10), then run npm install @nestjs/typeorm typeorm --save.

The default app happily serves up "Hello World!". My dependencies at this point look like this:

  "dependencies": {
    "@nestjs/common": "^10.0.0",
    "@nestjs/core": "^10.0.0",
    "@nestjs/platform-express": "^10.0.0",
    "@nestjs/typeorm": "^10.0.2",
    "reflect-metadata": "^0.2.0",
    "rxjs": "^7.8.1",
    "typeorm": "^0.3.20"
  },

And then in my AppModule I import TypeOrmModule just to see if it runs:

import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
    imports: [TypeOrmModule.forRoot({ synchronize: false })],
    controllers: [AppController],
    providers: [AppService],
})
export class AppModule {}

And I get the following error on the command line:

nestjs_api_dev  | [Nest] 79  - 01/14/2025, 7:53:23 PM     LOG [NestFactory] Starting Nest application...
nestjs_api_dev  | [Nest] 79  - 01/14/2025, 7:53:23 PM     LOG [InstanceLoader] TypeOrmModule dependencies initialized
nestjs_api_dev  | [Nest] 79  - 01/14/2025, 7:53:23 PM   ERROR [ExceptionHandler] (0 , rxjs_1.lastValueFrom) is not a function

What version of @nestjs/typeorm do I need to use to use the two together happily? How have other people navigated integrating NestJS 10 with TypeORM?

austere pulsar
#

the latest version of @nestjs/typeorm should work just fine for typeorm 0.3