aspnetcore: "Error: URL.pathname not implemented signalr" - @microsoft/signalr V8.0.0 on React-Native 0.72.7

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Hi,

I updated the @microsoft/signalr package on my react-native app from V7.0.12 to V8.0.0 and it stopped working after the update. The connection is failing when firing the start() method. The error: “Error: URL.pathname not implemented signalr”.

This is the code (which works fine with V7.0.12):

    let hubConnection = new HubConnectionBuilder()
        .withUrl(`${CONFIG.MOBILE_SERVER_BASE_URL}/${hubName}`, { transport: HttpTransportType.WebSockets })
        .build();

    hubConnection.start()
        .then(() => {
            ...
        })
        .catch((error) => {
            ...
        });

Thanks

Expected Behavior

Fix this bug

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

No response

Anything else?

No response

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 8
  • Comments: 15

Most upvoted comments

@abdulwahid211 Did you add import 'react-native-url-polyfill/auto'; in your entry-poin as per documentation? https://www.npmjs.com/package/react-native-url-polyfill#option-1-simple other than that, I don’t know where could be the problem