No metadata for “User” was found using TypeOrm

Adding answer bit late but its very common error. There are two main reasons for above error. In OrmConfig, You have used *.ts instead of *.js. For example, entities: [__dirname + ‘/../**/*.entity.ts’] <– Wrong It should be entities: [__dirname + ‘/../**/*.entity.js’] entities path is wrong. Make sure, entities path is defined according to dist folder … Read more

TypeORM Entity in NESTJS – Cannot use import statement outside a module

My assumption is that you have a TypeormModule configuration with an entities property that looks like this: entities: [‘src/**/*.entity.{ts,js}’] or like entities: [‘../**/*.entity.{ts,js}’] The error you are getting is because you are attempting to import a ts file in a js context. So long as you aren’t using webpack you can use this instead so … Read more