title: TypeORM fails to connect without any error message
body: <p>I am trying to get started with TypeORM, but cannot get createConnection to work. I run the default <code>tpyeorm init</code> server file, but there is not error or logging shown, nor is the postgres DB updated.</p>
  <p>index.ts</p>
  <pre><code>import &quot;reflect-metadata&quot;;
  import {createConnection, ConnectionOptions} from &quot;typeorm&quot;;
  import {User} from &quot;./entity/User&quot;;
  import * as ormconfig from '../ormconfig.json';
  
  console.log(&quot;is the file called correctly?&quot;);
  
  createConnection(ormconfig as ConnectionOptions).then(async connection =&gt; {//ive also tried removing this 'async' keyword, but that doesnt help
  
      console.log(&quot;Inserting a new user into the database...&quot;);
      const user = new User();
      user.firstName = &quot;Timber&quot;;
      user.lastName = &quot;Saw&quot;;
      user.age = 25;
      await connection.manager.save(user);
      console.log(&quot;Saved a new user with id: &quot; + user.id);
  
      console.log(&quot;Loading users from the database...&quot;);
      const users = await connection.manager.find(User);
      console.log(&quot;Loaded users: &quot;, users);
  
      console.log(&quot;Here you can setup and run express/koa/any other framework.&quot;);
  
  }).catch(error =&gt; console.log(error));
  
  console.log('is this code reached?')
  </code></pre>
  <p>ormconfig.json (note: I changed the postgres password to 'root')</p>
  <pre><code>{
     &quot;type&quot;: &quot;postgres&quot;,
     &quot;host&quot;: &quot;localhost&quot;,
     &quot;port&quot;: 5432,
     &quot;username&quot;: &quot;postgres&quot;,
     &quot;password&quot;: &quot;root&quot;,
     &quot;database&quot;: &quot;mhfit&quot;,
     &quot;synchronize&quot;: true,
     &quot;logging&quot;: true,
     &quot;entities&quot;: [
        &quot;src/entity/**/*.ts&quot;
     ],
     &quot;migrations&quot;: [
        &quot;src/migration/**/*.ts&quot;
     ],
     &quot;subscribers&quot;: [
        &quot;src/subscriber/**/*.ts&quot;
     ],
     &quot;cli&quot;: {
        &quot;entitiesDir&quot;: &quot;src/entity&quot;,
        &quot;migrationsDir&quot;: &quot;src/migration&quot;,
        &quot;subscribersDir&quot;: &quot;src/subscriber&quot;
     }
  }
  </code></pre>
  <p>running start gives the following output:</p>
  <pre><code>&gt; mhfit-server@0.0.1 start /home/james/Documents/mhfit/mhfit-server
  &gt; ts-node src/index.ts
  
  is the file called correctly?
  is this code reached?
  </code></pre>
  <p>Note that none of the other logging statements are hit. Why is that? Neither are errors shown.</p>
  <p>postgres databases on my local machine:</p>
  <pre><code>User$ sudo -i -u postgres
  'postgres@user:~$ psql
  postgres=# \list
                                    List of databases
     Name    |  Owner   | Encoding |   Collate   |    Ctype    |   Access privileges   
  -----------+----------+----------+-------------+-------------+-----------------------
   mhfit     | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
   postgres  | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | 
   template0 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
             |          |          |             |             | postgres=CTc/postgres
   template1 | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 | =c/postgres          +
             |          |          |             |             | postgres=CTc/postgres
  (4 rows)
  </code></pre>
  <p>The default <code>User</code> table is not created after trying to start the server</p>
  <pre><code>postgres-# \c mhfit
  You are now connected to database &quot;mhfit&quot; as user &quot;postgres&quot;.
  mhfit-# \dt
  Did not find any relations.
  </code></pre>
  <p><code>Update</code></p>
  <p>I followed and downloaded the code from <a href="https://dev.to/bnevilleoneill/how-to-build-a-graphql-api-with-typegraphql-and-typeorm-58fb" rel="nofollow noreferrer">this tutorial</a>, and magically it worked. But unfortunately my old project still failed...</p>
  <p>Eventually I tried messing with my models, and discovered that the failure was due to TypeORM not liking how I setup some of my models. I have a model, <code>A</code> that can have two arrays of model <code>B</code> (Bs that exist before event A, and Bs that exist after event A).</p>
  <p>In TypeORM I had set this up to be 2 OneToMany relationships on A, and 2 ManyToOne relatonships on the B class. Something about this crashed TypeORM though. What is the correct way to do this instead?</p>
  <p>A:</p>
  <pre><code>...
  @OneToMany(type =&gt; B, preB =&gt; preB.preA)
  preBs: B[];
  @OneToMany(type =&gt; B, postB =&gt; postB.postA)
  postEmotions: B[];
  </code></pre>
  <p>B:</p>
  <pre><code>...
  @ManyToOne(type =&gt; A, preA =&gt; preA.preBs)
  preA: A;
  @ManyToOne(type =&gt; A, postA =&gt; postA.postBs)
  postA: A;
  </code></pre>