title: Unable to compile typescript on heroku
body: <p>I am trying to deploy a typescript nodejs app using express to heroku, the code is pushed up fine, heroku installs the dependencies and then runs <code>tsc</code> but crashes with <code>src/controller/adminTypes.ts:3:34 - error TS2307: Cannot find module '../repo/adminTypes'.</code>.</p>
  
  <p>I checked the line where the import happens and it looks like this </p>
  
  <p><code>import { insertAdminTypes } from "../repo/adminTypes";</code></p>
  
  <p>The equivalent export happens like so</p>
  
  <pre><code>export const insertAdminTypes = async queryObj =&gt; {
    // code
  };
  </code></pre>
  
  <p>VSCode resolves the paths perfectly fine, when I try running tsc locally everything compiles fine and I get the compiled files in the <code>dist</code> folder. It's only heroku that seems to be throwing an error for the paths online. This doesn't happen for every file, the above <code>TS2307</code> error is thrown only for a few files.</p>
  
  <p>These are the following config files.</p>
  
  <p><strong><code>package.json</code></strong></p>
  
  <pre><code>{
    "name": "express_server",
    "version": "0.0.1",
    "license": "UNLICENSED",
    "main": "./src/server.ts",
    "scripts": {
      "build-ts": "tsc",
      "start": "npx nodemon",
      "prod": "npx run build-ts",
      "postinstall": "npm run build-ts"
    },
    "dependencies": {
      "@types/body-parser": "^1.17.0",
      "@types/dotenv": "^6.1.0",
      "@types/express": "^4.16.0",
      "@types/jquery": "^3.3.22",
      "@types/node": "^10.12.2",
      "@types/underscore": "^1.8.9",
      "bcrypt": "^3.0.2",
      "body-parser": "^1.18.3",
      "dotenv": "^6.1.0",
      "express": "^4.16.4",
      "express-handlebars": "^3.0.0",
      "jsonwebtoken": "^8.3.0",
      "mongodb": "^3.1.9",
      "mysql": "^2.16.0",
      "nodemon": "^1.18.6",
      "reflect-metadata": "^0.1.12",
      "ts-node": "^7.0.1",
      "typeorm": "^0.2.8",
      "typescript": "^3.1.6",
      "underscore": "^1.9.1"
    },
    "devDependencies": {
      "husky": "^1.1.3",
      "lint-staged": "^8.0.4",
      "prettier": "^1.15.2",
      "pretty-quick": "^1.8.0",
      "tslint": "^5.11.0",
      "tslint-config-prettier": "^1.15.0",
      "tslint-plugin-prettier": "^2.0.1"
    },
    "husky": {
      "hooks": {
        "pre-commit": "pretty-quick --staged"
      }
    },
    "lint-staged": {
      "linters": {
        "*.{ts}": [
          "npx tslint --fix",
          "git add"
        ]
      },
      "ignore": [
        "./public",
        "./environment",
        "./node_modules"
      ]
    }
  }
  </code></pre>
  
  <p><code>nodemon.json</code></p>
  
  <pre><code>{
    "ignore": ["**/*.test.ts", "**/*.spec.ts", ".git", "node_modules"],
    "watch": ["src"],
    "exec": "npx ts-node ./src/server.ts",
    "ext": "ts"
  }
  </code></pre>
  
  <p><code>tsconfig.json</code></p>
  
  <pre><code>{
    "compilerOptions": {
      "module": "commonjs",
      "esModuleInterop": true,
      "target": "es6",
      "noImplicitAny": false,
      "moduleResolution": "node",
      "sourceMap": true,
      "outDir": "dist",
      "pretty": true,
      "baseUrl": ".",
      "alwaysStrict": true,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "paths": {
        "*": ["node_modules/*", "src/types/*"]
      }
    },
    "include": ["src/**/*.ts"],
    "exclude": ["node_modules"]
  }
  </code></pre>