Instead of uploading the precompiled dist directory, I want to compile src at server side instead.
Here are my scripts inside package.json:
\"scripts\":
You need to call tsc from an npm script. Otherwise Heroku tries to find a global dependency named tsc.
tsc
Create a new npm script in your package.json:
package.json
"tsc": "tsc"
now replace "postinstall": "tsc" with:
"postinstall": "tsc"
"postinstall": "npm run tsc"