I have two entities: User and Habit. A user can create multiple Habits, thus I use a OneToMany relation on the User (and
I solved this by using autoLoadEntities: true when loading the TypeORM config to NestJS. Note that this is a NestJS extra, so if you are using ormconfig.json this property won't be applied.
autoLoadEntities documentation here: https://docs.nestjs.com/techniques/database#auto-load-entities
UPDATE 04/10/2020
I kept having the same issue with relations. Another solution I found, even if it breaks some standards is to add all the Entities into 1 file. Export them there and import them where needed.
Keep in mind that the order in which the classes are declared matters.