I came across exactly the same issue.
In my case, the error is due to "Overleaf" extension I installed, which was set as the default pdf previewer. And Overleaf cannot read the URI scheme like "file://*.pdf".
Solution: click "open with..." and select another previewer. enter image description here