Search code examples
blazorrefreshblazor-server-side

Blazor Server error aspnetcore-browser-refresh.js:234 WebSocket connection to 'wss://localhost:56871/' failed


Running a Blazor Server app is showing a partially rendered page with a browser console error of:

aspnetcore-browser-refresh.js:234 WebSocket connection to 'wss://localhost:56871/' failed

It would appear that no recent changes have been made to the code. There doesn't seem to be any code issues, how can I go about isolating this issue?


Solution

  • EDIT:

    This issue has now been fixed in v17.1.5. You would want to update to this version.

    Reference to release notes: https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-notes#17.1.5

    Original Answer to rollback install:

    It appears that this is a bug in Visual Studio v17.1.1. If I revert back to v17.0 then the application launches successfully.

    FIX:

    1. Uninstall Visual Studio v17.1.1 (via VS Installer)
    2. Install specific version v17.0.7 package from https://learn.microsoft.com/en-us/visualstudio/releases/2022/release-history

    Reference to the bug (a report indicates it is also present in 17.1.2): https://developercommunity2.visualstudio.com/t/WebSocket-connection-to-wss:-fail/1670519?q=ERR_CONNECTION_RESET&ftype=problem&space=8&stateGroup=active&sort=newest