0

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?

2
  • It sounds like the code you have running on Heroku isn't what you're testing against. Try running heroku releases and compare the git hash with the latest git hash you have locally.
    – rdegges
    Aug 5, 2016 at 15:44
  • I'm using CircleCI to automatically deploy once tests pass, it would be really weird if the repo was somehow altered on its way. I don't think that's the problem.
    – Ludwik
    Aug 6, 2016 at 6:57

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.