-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tsc-watch compiles/starts 2x/change and ramp-up is slow #85
Comments
Sorry, I don't understand what is the problem and what you mean by 2x/change. |
Thanks for the quick response. On file change tsc-watch compiles and starts the app two times. IDK how I can describe it better. It just does everything two times. More infos: in tsconfig I specified |
You are probably doing something wrong, it doesn't suppose to do it twice for sure. |
Thanks for your support! Since I switched already to concurrently + nodemon I would need to go back. I could do this the later the day. I really tinkered with tsc-watch few hours and couldn't get it working properly and fast. Maybe you just try my solution and compare output and speed with your solution in a Docker container (until I can try tsc-watch again) and you might find the issue with tsc-watch yourself. |
didnt test it but maybe helpful for you: if sourceMap is true, always two build files (js + map) are generated and hence your lib is doing everything twice while nodemon has a default delay of 1sec before it restarts and hence just restarts once. maybe it's that?? |
here man, fyi, you get even more control on tsc's watch technique (tldr default fswatch is unreliable): https://www.typescriptlang.org/docs/handbook/configuring-watch.html I am just testing eg RecursiveDirectoryUsingDynamicPriorityPolling and things get even faster! |
Regarding "fswatch is unreliable", I will test it. Regarding your problem, the source maps shouldn't cause any issue... I'm using typescript to detect compilation complete, and then just run the I still don't understand how to reproduce your problem... I need some way to see that happen... maybe just create a repo.? allow me to see your repo.? share your setup? something... |
Maybe you are allowing typescript |
sorry that I haven't come back yet, I remember that the compilation steps are caused by a file and a directory compile trigger which again do not happen with nodemon because you have an default delay of 1 sec. i try to setup an example repo hopefully next week |
Hi, did you test your issue?
|
@gilamran I ran into this issue as well. Here is how I would describe it with my project: Every change causes the compiler to run twice. The first run is brief (<1s) and is cut short by the second run, which completes successfully. |
@desmap Removing Update: the relevant typescript issue is here: microsoft/TypeScript#37994 and adding the |
@hillaryan Thanks for the update and the issue follow. |
Same issue, rolling back to Typescript 4.8.4 solves the issue in the meantime (it's a typescript issue) |
Looks like this issue was closed, is this still happening for you on the latest typescript? |
"dev": "tsc-watch --noClear --onSuccess \"node dist\""
compiles and starts always 2x/change. When replacingnode
bynodemon
and--onSuccess
by--onFirstSuccess
it compiles and starts properly once per change. But even then it feels sluggish.FWIW, meanwhile, I use
"dev": "concurrently \"tsc -w\" \"nodemon dist\""
which works properly (1x compile & start/change) and is quite snappy.The text was updated successfully, but these errors were encountered: