aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

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

Open erez-unitronics opened this issue 1 year ago • 12 comments

Is there an existing issue for this?

  • [X] 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

erez-unitronics avatar Nov 15 '23 10:11 erez-unitronics

I have the same issue

Philip970 avatar Nov 22 '23 13:11 Philip970

Same issue here

elandref93 avatar Nov 28 '23 11:11 elandref93

Can anyone help to solve this error, I'm also getting the same error.

ruchishah848 avatar Nov 28 '23 12:11 ruchishah848

same error for me as well with version 8.0.0

DanShepherd27 avatar Dec 02 '23 20:12 DanShepherd27

same error for me as well with version 8.0.0

SapsayArtyom avatar Dec 05 '23 01:12 SapsayArtyom

same error with version 8.0.0

rajsawhoney avatar Dec 11 '23 08:12 rajsawhoney

Same issue, reverting back to v7 fixed it for me. Looks like something is wrong in v8 for react native

austinGENEreeve avatar Dec 12 '23 20:12 austinGENEreeve

The same issue is reproducible with v8.0.0 of @microsoft/signalr package in the React Native environment. Works well after rolling back to v7.0.12.

vvadyak avatar Dec 15 '23 14:12 vvadyak

Installing https://www.npmjs.com/package/react-native-url-polyfill did the trick for me

vasafix avatar Dec 19 '23 03:12 vasafix

@vasafix Thanks! your solution works for me

erez-unitronics avatar Dec 25 '23 09:12 erez-unitronics

Installing https://www.npmjs.com/package/react-native-url-polyfill did the trick for me

I installed it, it did not resolve the issue. What did you exactly?

abdulwahid211 avatar Feb 23 '24 18:02 abdulwahid211

@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

vasafix avatar Feb 24 '24 08:02 vasafix

Installing https://www.npmjs.com/package/react-native-url-polyfill did the trick for me

Thanks for your help!.

tkyr-hh avatar Mar 07 '24 08:03 tkyr-hh

Installing https://www.npmjs.com/package/react-native-url-polyfill did the trick for me

Thanks for your help!.

ramkumar457 avatar Apr 01 '24 12:04 ramkumar457

Thanks, it works for me @vasafix

hoangnv170752 avatar Jul 27 '24 09:07 hoangnv170752