Prevent ts server from crashing every 5 mins

How to prevent ts server from crashing every 5 mins ?
12 Replies
abcdef
abcdefOP2y ago
Crashes instantly when I restart it
abcdef
abcdefOP2y ago
abcdef
abcdefOP2y ago
This takes 30 sec to run
whatplan
whatplan2y ago
I know these are kinda stupid solutions but you can try: restarting vs code restarting computer buying more memory
abcdef
abcdefOP2y ago
Restarting my computer every 30 seconds wouldn't be an efficient use of time. I'd much rather avoid that.
bostonsheraff
bostonsheraff2y ago
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
abcdef
abcdefOP2y ago
Ok I'll try that Didn't help
bostonsheraff
bostonsheraff2y ago
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 @whatplan
abcdef
abcdefOP2y ago
Guys I solved it I upgraded to next app dir And removed this shitty trpc library
barry
barry2y ago
Hehe, sounds like potato pc but yes it’s heavy for most, usually not ”crashing” heavy
abcdef
abcdefOP2y ago
32 gb ram should be enough? It's a big project though 100+ components and like 30 pages
barry
barry2y ago
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
Want results from more Discord servers?
Add your server