Advertising is a valid way to make money, it just stopped being a way to make enough money for the typical scenarios (low-effort individual hosting, VC-forced growth).
Compute, storage and bandwidth have all significantly lowered in price over time, but moderation and hosting costs haven't as internet proliferation, legal requirements and media standards kept growing.
There hasn't been much focus in keeping costs low.
The most effective workflow for working with JavaScript is now installing a separate OS to install an installer for another virtual machine that installs an installer for an installer that installs build tools which install installers for dependencies to build 10 lines of code. Docker singlehandedly made "It works on my machine!" "Then ship the entire machine!" into a dogma.