Slightly modified, taking into account feedback since I posted it:
I was having this issue with one of the accounts on our family PC. OneDrive worked for all the other users. The reset suggested in this post on Oct 23, 2025 didn't fix the issue. The solution I present here is one I found through experimentation. It worked for me and, as you can see from the number of people who found it helpful and most of the replies below, it worked for many others too. However, a small number of people found it didn't work, and without knowing more about their Windows environment, I cannot say why. So in summary, there is a good chance this fix will work and a small chance it won't; if it doesn't, the issues causing it are probably more complicated than they were for those of us for whom it worked, and I am sorry if it doesn't work for you, in which case I would suggest contacting Microsoft support (which this channel is not).
This is what worked for me. Please be very careful when making changes in the registry. I take no responsibility for any issues you may encounter through incorrect use of the Registry Editor.
Make sure nobody else is logged in by checking Task Manager and the Users tab, and log out anyone who is logged in.
Make sure OneDrive isn't running for you. If it is, quit OneDrive
Open the Registry Editor using regedit
Rename "Computer\HKEY_CURRENT_USER\Software\Microsoft\OneDrive" to "Computer\HKEY_CURRENT_USER\Software\Microsoft\OneDrive.old" (by navigating to "Computer\HKEY_CURRENT_USER\Software\Microsoft", finding "OneDrive" underneath, right-clicking "OneDrive" and renaming it to "OneDrive.old")
Restart the computer, log in, then start OneDrive if it isn't already running. It should now work properly, as it did for me and many others.