Is it better to ignore harmless errors?

I am currently working on a website to track my shots in Archery (I like doing that) and I am currently working on the part to display data the data. I am getting a type error from TS (I think) when I add types to the vanilla JS (note that works just fine). The error is logged to the console but the code still works, the correct value returned and stuff. So should these harmless errors be ignored so you don’t spend days debugging when you should be working on other stuff?

8 Likes

Not a TypeScript programmer, don’t plan to be soon, but that is a matter of preference and personality.

If you’re a perfectionist and want to make sure absolutely everything is in order, then you would probably want to spend time fixing even the littlest errors in your code, even if its pointless.

If you aren’t, and just want to create a website for it to work, then it’s more of a 50/50 thing. If your project is small, then you could probably get away with leaving those errors alone, but if your project is large and you plan to expand it even further, I would highly recommend doing your best to fix anything problematic, as who knows what could happen. If you spend 30 minutes debugging now, you won’t have to spend 4 hours later debugging why the module you just imported isn’t working.

In general though, it’s probably the best habit to at least attempt fixing any issues, even if you could get away with leaving them be.

(Also, no error is harmless, otherwise, it just wouldn’t be displayed at all. Even though warnings aren’t necessarily issues, that is only the case until they do become issues.)

8 Likes

My opinion: If the error does not affect anything, then it is safe to ignore the errors. However, it can make a mess in the console. It can be nice to fix it, but it’s easier just to ignore these errors. :slight_smile:

6 Likes

My two cents:
I especially agree with that last part of @bobastley’s comments, an error left unchecked could become an issue later on, or it might have unforeseen issues. That said, some errors are more like warnings and its good to differentiate between the two, warnings don’t always necessarily need to be handled.

A type error is probably something worth handling because it could mean you’re passing some value/s of an unexpected type and are potentially relying on implicit conversions/type coercion or something somewhat hacky.

5 Likes

Looking into it morew its a TypeError caused by the node-fetch package. So my guess its a bug but I would need to test further to confirm that.

And it is an error
image

5 Likes