you don't spend 1 hour trying to understand type errors that look like this
you don't spend 1 hour trying to understand type errors that look like this https://t.co/vsPNl8T7Wy
@webdevcody Thank me later, homie. marketplace.visualstudio.com/items?itemName…
@webdevcody Well, it's just saying that you don't have to return a number
@webdevcody im a noob in typescript , when I see these type errors , instant migraine
@webdevcody 1. I'm shocked at how many people don't know about the Pretty Typescript Errors VSCode Plugin. 2. This looks simple to debug. You're passing a promise that resolves to a number, but a promise that resolves to void is expected.
@webdevcody There are cryptic error messages, but this is far better than the worst I've seen lol.
@webdevcody Well I think you need pretty TS Errors. marketplace.visualstudio.com/items?itemName…
@webdevcody Yes, because it's so much better to debug that same problem in production instead
@webdevcody When I switched from Android Studio (IntelliJ) to VS Code, I was surprised by how much less readable the error messages are.
@webdevcody that is the type system of typescript that allows very complex types, not only does it happen with errors, when I want to see the signature of a function from a library that uses very complex types something similar happens
@webdevcody Or you could just copy/paste it into ChatGPT and let it decipher what is going on I find it doesn't always get it perfect -- but it can often give one or two reasonable suggestions on how to fix type errors given enough context
@webdevcody The best type is <any|none> Types seem good for interfaces between two distinct, evolveable systems. The GQL layer for types feels natural to me. The client & server should reliably know what is able to be transmitted since both can evolve in isolation. Most code ain't that.
@webdevcody thats not a benefit, u wud still come back to it come
@webdevcody Allow me to introduce this nifty extension! marketplace.visualstudio.com/items?itemName…
@webdevcody Yeah but then you can spend 4 hours trying to understand why isn’t undefined a function
@webdevcody I agree TS errors might be a bit overwhelming. However, inability to see possible thought-holes does not mean it isn't there. Also, there are plugins that make those error messages prettier
@webdevcody i paste it into copilot and tell it to convert it to English
@webdevcody i hate when this is called "typed". That shit is not typed, it's spaghetti
@webdevcody Indeed. Much better to understand them as runtime errors instead
@webdevcody instead you get runtime errors instead of compile time errors or the error message is so vague it couldve just said "i think you have a bug somewhere"