title: Error: Object metadata not found after adding many-to-many relationships
body: <p>I need to have additional properties for many-to-many relationships, I created a new entity myself as shown in the documentation. </p>
  
  <p><a href="https://github.com/typeorm/typeorm/blob/master/docs/many-to-many-relations.md#many-to-many-relations-with-custom-properties" rel="nofollow noreferrer">https://github.com/typeorm/typeorm/blob/master/docs/many-to-many-relations.md#many-to-many-relations-with-custom-properties</a></p>
  
  <p>It's user entity.</p>
  
  <pre><code>import { Entity, PrimaryGeneratedColumn, Column, OneToMany } from 'typeorm';
  import { ShareTask } from './../../share-taks/entity/share-taks.entity';
  
  @Entity('users')
  export class User {
      @PrimaryGeneratedColumn()
      public id: number;
  
      @Column({ type: 'varchar', nullable: false })
      public email: string;
  
      @Column({ type: 'varchar', nullable: false })
      public password: string;
  
      @OneToMany(() =&gt; ShareTask, (shareTask: ShareTask) =&gt; shareTask.user)
      public shareTask: ShareTask[];
  }
  </code></pre>
  
  <p>It's task entity.</p>
  
  <pre><code>import { Entity, Column, PrimaryGeneratedColumn, OneToMany } from 'typeorm';
  import { ShareTaks } from './../../share-taks/entity/share-taks.entity';
  
  @Entity('tasks')
  export class Taks {
      @PrimaryGeneratedColumn()
      public id: number;
  
      @Column({ type: 'varchar', nullable: false, length: 50 })
      public title: string;
  
      @OneToMany(() =&gt; ShareTaks, (shareTaks: ShareTaks) =&gt; shareTaks.taks)
      public shareTaks: ShareTaks[];    
  }
  </code></pre>
  
  <p>It's ormconfig.json.</p>
  
  <pre><code>{
      "type": "mysql",
      "host": "localhost",
      "port": 3306,
      "username": "root",
      "password": "7047",
      "database": "db",
      "entities": ["dist/**/*.entity{.ts,.js}"],
      "synchronize": true
  }
  </code></pre>
  
  <p>It's ShareTaks entity.</p>
  
  <pre><code>import { Entity, PrimaryGeneratedColumn, Column, ManyToOne } from 'typeorm';
  import { User } from './../../users/entity/user.entity';
  import { Taks } from './../../taks/entity/taks.entity';
  
  @Entity('shareTasks')
  export class shareTask {
      @PrimaryGeneratedColumn()
      public id: number;
  
      @Column({ type: 'integer', nullable: false })
      public taskId: number;
  
      @Column({ type: 'integer', nullable: false })
      public userId: number;
  
      @ManyToOne(() =&gt; (task: Task) =&gt; task.shareTask, { cascade: ['insert', 'update', 'remove'] })
      public task: Task;
  
      @ManyToOne(() =&gt; (user: User) =&gt; user.shareTask, { cascade: ['insert', 'update', 'remove'] })
      public user: User;
  }
  </code></pre>
  
  <p>Before I made a many-to-many relationship, everything worked well. When I added a many-to-many relationship, I get an error. </p>
  
  <blockquote>
    <p>Error: Entity metadata for ShareTask#task was not found. Check if you specified a correct entity object and if it's connected in the connection options.</p>
  </blockquote>
  
  <p>Because of what I get an error, I can’t understand.</p>
  
  <p>I found some answers to my question, but they did not help me.</p>
  
  <p><a href="https://stackoverflow.com/questions/56693067/entity-metadata-for-roleusers-was-not-found">Entity metadata for Role#users was not found</a></p>
  
  <p><a href="https://github.com/typeorm/typeorm/issues/420" rel="nofollow noreferrer">https://github.com/typeorm/typeorm/issues/420</a></p>