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,

  1. You have used *.ts instead of *.js. For example,
entities: [__dirname + '/../**/*.entity.ts']  <-- Wrong

It should be

entities: [__dirname + '/../**/*.entity.js'] 
  1. entities path is wrong. Make sure, entities path is defined according to dist folder not src folder.

Leave a Comment