EntityMetadataNotFound: No metadata for "Task" was found - NestJS

In NestJS adding .js along side .ts worked for me

typeorm.config.ts

Before

import { TypeOrmModuleOptions } from '@nestjs/typeorm';

export const TypeORMConfig: TypeOrmModuleOptions = {
  type: 'postgres',
  url: process.env.DATABASE_URL,
  synchronize: true,
  entities: [__dirname + '/../**/*.entity.ts'],
  migrationsTableName: 'Migrations_History',
};

After

import { TypeOrmModuleOptions } from '@nestjs/typeorm';

export const TypeORMConfig: TypeOrmModuleOptions = {
  type: 'postgres',
  url: process.env.DATABASE_URL,
  synchronize: true,
  entities: [__dirname + '/../**/*.entity{.ts,.js}'],
  migrationsTableName: 'Migrations_History',
};

entities: [__dirname + '/../**/*.entity.ts']

to

entities: [__dirname + '/../**/*.entity.js']

in typeorm.config.ts

it works on me