I have a typescript project and want my running code to get generated by heroku when I deploy. I therefore added "postinstall": "tsc"
to package.json
so that tsc
would be run on heroku after npm install
is complete (I do have typescript in my dependencies).
It does run, but for some reason, tsc crashes with RangeError: Maximum call stack size exceeded
on an obscure file .heroku/node/lib/node_modules/npm/node_modules/slide/lib/async-map-ordered.js
which it shouldn't be running on at all. This setup works perfectly on my machine, on Circle.ci, and on a freshly cloned repo.
I had a theory that maybe tsc was being run in the wrong directory, but when I used pwd && ls && tsc
It printed the correct directory (/tmp/build_5292b1b9c3c13c35489f46510acb565e
) and the files that are in my directory.
My question is: Why is tsc
running in this strange way on heroku, and what do I have to do to make typescript work on a heroku deployment?
heroku releases
and compare the git hash with the latest git hash you have locally.