A reliable dynamo hub setup can be very cool for the right situation, but the up front investment to rebuild your wheel around a dynamo hub is expensive. The power output is also on the low side compared to the light output you can get from the battery units.
Not having to charge anything or worry about batteries running out in the dark is a real benefit.
It's all on the very opposite end of the cost spectrum than the cheap bike light in this post though
The old-school dynamos cost 10-20 bucks: https://axabikesecurity.com/product/axa-8201-right/
They're just generic AC motors held against the rim, as simple and cheap as it gets. Nowadays I'd add a basic voltage regulation circuitry to get a stable 5V DC out of it.
That's why I said "reliable" in my post.
You'll spend more time futzing with one of or dealing with weather-related failures that you would have saved more time charging a pile of batteries before every ride.
That overstates their unreliability. Such dynamos used to be universal before modern rechargeable batteries and worked well enough, I don't recall ever having to replace or maintain one. For dirt roads where mud gets everywhere, non-mechanical options are of course better, but simple dynamos perfectly are fine on regular city streets, country roads and dry paths. They're especially good for kids who can't be bothered to keep batteries charged.
I don't remember a period of my life where bottle dynamos have not been unreliable when it rains, and it rains a lot here (or it used to, anyway).
I have rigged all kinds of rubber contraptions to make them work better, I have made my own dynamos from old electric motors as a kid, and yet I have never in all those decades found a way to be sure they would work when I need them, never.