And yet, for the same quantity of energy over the same timeframe, nuclear is cheaper. It's not so much that it loses because of economics, it's losing because of the perceived uncertainty of the economics.
Risk, not uncertainty. The long-term (or even medium-term) pricing situation for renewables is highly volatile right now. It makes investing in new nuclear extremely risky financially. What if you start building a plant now, expecting a certain energy price to pay for it over decades, and by the time you finish, solar power costs half as much as your target? That could well happen. That's how utility companies go bankrupt.
Does that factor in the upfront cost of building the reactor? IIRC it takes 30 years to get a return on investment for reactors, which is a non issue if the reactors are public but definitely a tough pill for the private sector to swallow.