Nothing can be 100% reliable and stable when your house is built from parts which other people are changing all the time. What helps: testing, locking to specific versions, reducing your dependencies. But that's not specific to JavaScript, that's pretty much the entire house of cards which we call software development.
Edit: Somewhere else I saw the phrase, "cultural problem". That describes the situation with JavaScript and the reason for the author's hellish journey debugging an issue introduced by indirectly updating an obscure dependency. But culture can be improved, and it has been evolving to be more serious about reliability.
Will we ever awake from the nightmare of history? I mean, JavaScript? No, it's part of our legacy now: as the article described, JavaScript code is running all over the globe, including enterprise-scale, important and serious things. We have to work from within the system to reform it. And probably gradually replace it with WASM, for better or worse.