The problem is too much reliances on frameworks and add on libraries.
Developers will import an entire framework that for the benefit of a single feature. It's mind blowing to look at the amount of js includes for seemingly simple sites.
Stackoverflow answers that direct you to import a library or framework should be banned in most cases.
I will often have to scroll past several answers that say to import a library before finding a simple and functional answer that uses only a few lines of code down near the bottom. Which in my eyes is the real answer. I often wonder if there's a behind the scenes effort on SO to promote certain includes.
The entire ecosystem of some languages / implementations relies on this far too heavily.
We are seeing some of the consequences other than just bloated systems from this style of coding with malicious node packages.