I spent today just trying to use nunjucks for serving some templated html. Turns out nunjucks among other templating libraries are fucking broken because of this rtarded split between cjs and mjs.
Even though I have a custom toolchain to deal with this sht, typescript made some changes that broke the server portion. The mjs files can't import nunjucks. This isn't the first time sht has broken either hence why the toolchain exists.
I was like ok since ths is broken time to explore. So I explored leptos, but that is too big. 4MB Wasm lmfao, no. I saw how easy lit-ssr was, but its experimental. I mean the site I wanted to change is all lit like this site for instance. I gave up looking and started using GPT to translate nunjucks code to esm, but i got tired and gave it up after 2 hours. Hallucinations and sht.
Look, I'm done with NodeJS bs for any backend from now. Breaking change after change is too much. It's throwing away lots of people's work. You can no longer pick this and that library anymore. You're either full on CJS or MJS. F that.
Rust has a templating library that works just like the one I was using so I'm going in that direction. I really don't care for SSR garbage, it's tiring to think about and and realistically ssr is for web apps, not web sites. NodeJS is why JS based SSR is even a thing. It's a waste really. Just serve html and use web standards at this point.