There is so much wrong about Javascript revealed here that I think we have to question its use going forwards.
Did this just occur to you now?
The language itself is a great start to programming websites
Nope, it isn't. It seems great but that's only up until you realise that you've been deluding yourself. For some, this never happens, which stands to reason because it'd make them ashamed of that fat paycheck.
but the need for frameworks,
It starts way before this, but yes, that should have told you that javascript is not great, because no staying power. It's fairly natural for a programmer to try and build higher abstractions on the building blocks available, and that's fine. What would not be fine, and happens to be everything "frameworks" inside javascript is trying to do, is to fix deficiencies that seep through "from below".
Those deficiencies aren't just inside javascript, but also inside the modeling inside the browser (ever seen a non-leaky one?), html, the assumptions on which websites are "programmed", and so on, and so forth. Consider, for one very fundamental issue, that originally, the same text differently rendered on different devices was not a bug, but a feature.
Or that websites ought not to need to be "programmed" but should be simply a collection of easily served documents for sharing and collaborative work. That was the idea, not the million monkeys adding code to content that ought to need no further programming to function as originally envisioned.
See how deep the rabbit hole reaches before we even get to the meat of your complaint?
which become "flavours of the month" [...]
Yep, maintainability of your current framework goes right out the window here. Long-term viability of the content already left the building long before that, though.
The rest is just follow-on damage that we're forcibly trying to power through. Won't work, but lots of paychecks for people involved in the tech industry somehow. Nevermind that they're not actually programmers, as you point out. Programming is a rare talent.
Who was it again that noted that in a few short years influx into the CS department had gone up to tenfold, but the absolute number of people with actual talent, always less than the total student population, had stayed about the same? Meaning that the more you clamour for "IT talent", the more monkeys you'll get.
Which in turn gets us the problems you describe. Among other things.
What about security of the various frameworks and ensuring they don't do anything nefarious.
This went out the window as soon as "running code from this here website in my browser" entered the picture. The rest is just secondary damage; imortant only to individual websites that care about public outcries, but about as sensible as "due diligence" in the finance industry. It helps the browser user nothing at all.
Consider that the lastest security scare, that with speculative execution and cache effects allowing peeking through the security in hardware is exploitable from javascript, which is how many layers up in software? This is a leaky bucket. You cannot plug the holes by adding more water.
I'm not sure I see a solution for these problems.
That's because you're looking at the problems from the wrong level.
The fix as the end-user is to not run javascript in your browser. So the only real option for website owners is to make sure your website will function properly with a javascript-free browser. There is no middle way on this. It certainly cannot be fixed by adding more javascript, whether in "framework" form or not.
Maybe WebAssembly will be the ultimate solution (with tested and supported libraries that web developers can use and rely on) but I'm hoping that W3C and other groups are looking ahead to the next generation of web development tools.
You are wishing for a silver bullet (HA HA HA HA) and that the W3C --built on the premise that standardisation does not require competence, dixit Naggum-- will suddenly turn competent (idem). Nay, you're hoping the W3C will suddenly become way more than competent and recast reality to fix the unfixable. Syeah, that'll happen.