azure-functions-core-tools icon indicating copy to clipboard operation
azure-functions-core-tools copied to clipboard

Use ts-node for Typescript Projects

Open grbspltt opened this issue 4 years ago • 10 comments

It would be really nice to use ts-node under the hood for typescript projects when developing. Debugging errors would be far easier seeing where the error happened in the TS code vs compiled JS.

grbspltt avatar Nov 18 '20 21:11 grbspltt

@mhoeger could you please take a look at this?

apawast avatar Nov 18 '20 21:11 apawast

Hi @grbspltt - we're not very likely to fix this, it's quite a bit of work for a very specific scenario for us (especially because we would not want to run with ts-node in production for perf reasons).

One thing we are working on is fixing this, so that file changes can be made while debugging: https://github.com/Azure/azure-functions-host/issues/3543. Hopefully any errors are going to be easier to see and debug with a debugger attached. Please let us know if this wouldn't meet your need and we can consider it for the future, although please note that we are unlikely to implement this specific ask.

mhoeger avatar Nov 18 '20 23:11 mhoeger

@mhoeger Thanks for the response. I would expect that using ts-node would be for development purposes only. I don't know anything about what happens under the hood when func start is run but perhaps a command like func start-dev could use ts-node and the source files instead of dist.

What I'm really looking for is a simpler way to read error messages. I see the source maps in dist, but they aren't used when errors come up.

grbspltt avatar Nov 19 '20 07:11 grbspltt

Would love to see support for this as well!

hlz avatar Nov 19 '20 11:11 hlz

BUMP! Let's keep this one in the spotlight

gidich avatar Mar 29 '21 22:03 gidich

This would be a great feature to have!

etang93 avatar Apr 01 '21 20:04 etang93

This would speed up the development process a lot!

nguyenduy avatar Apr 01 '21 20:04 nguyenduy

This is something I have been expecting to see for a long time now! Its very inconvenient to stop/start the debug session everytime we make a change.

mogupta-ecfmg avatar Apr 04 '21 20:04 mogupta-ecfmg

Would be great if this was included in the tools.

As a temporary solution, I'm running tsc -w in another bash tab.

tuomaskujala avatar May 06 '21 04:05 tuomaskujala

What is the guidance for debugging TypeScript projects? EDIT: Had to manually adjust ports for inspection as mentioned here https://stackoverflow.com/a/55932453/18146992

thomasgauvin avatar Mar 14 '22 18:03 thomasgauvin