Prevent ts server from crashing every 5 mins
How to prevent ts server from crashing every 5 mins ?
12 Replies
Crashes instantly when I restart it
This takes 30 sec to run
I know these are kinda stupid solutions but you can try:
restarting vs code
restarting computer
buying more memory
Restarting my computer every 30 seconds wouldn't be an efficient use of time. I'd much rather avoid that.
restarting just once has miracle effects sometimes
but here's another thing you can try: in the command palette type "select TS version" and tell vscode to use the typescript version in the node_modules instead of its own version. idk why but even when it's the same, it sometimes makes it work
Ok I'll try that
Didn't help
Things you might look into:
- on my old laptop (2014 macbook) I disable eslint because it's too heavy
- if you're using
pnpm
, some of the modern module resolution strategies can cause out-of-memory exceptions in monorepos (node-linker: hoisted
specifically)
- overly complex types can have a huge impact on typescript (union combinatorics is exponential, and above 5M cases, TS bails on some stuff) so adding explicit types in some strategic places can dramatically increase performance
- looking at the "activity monitor" of your OS to see what eats up the RAM / CPU during these crashes might shed some light on which process is guilty
- if your project is big (> 100k of lines of typescript) and cannot be simplified you could look into some of the remote dev environments by GitHub (there is a free tier)
But before all that, my first recommendation would be that of @whatplanGuys I solved it
I upgraded to next app dir
And removed this shitty trpc library
Hehe, sounds like potato pc but yes it’s heavy for most, usually not ”crashing” heavy
32 gb ram should be enough?
It's a big project though
100+ components and like 30 pages
Ram isn’t everything but it’s enough yeah 🤷
I get the same ESLint problem here and there when saving, sometimes just takes 30 seconds 😐 but no crashes