Closed marco-a closed 8 years ago
Thanks for reporting. It seems that in safari typeof WebSocket === 'object'
while in other browsers typeof WebSocket === 'function'
. Will fix that asap
The issue should have been fixed. Please, ping me if you have any problems.
Thanks!
👀 Sorry, I didn't read this thread properly and came to the same conclusion! Sorry. Still seems to be an issue in the current version though.
Ah, yes. I see the fix was applied in the isGlobalWebSocket
function, but not further down (line 81 of index.ts
).
Hi, still seems to be a problem with this. Apologies, I'm currently debugging the built code, I'll try and fix in the source and PR later.
The problem is old Safari reports typeof WebSocket
as "object", not "function". This fails the check in line 63 of the built code:
if (typeof config.constructor !== 'function') {
throw new TypeError('WebSocket constructor not set. Set `options.constructor`');
}
You can recreate this on desktop if you use the stable Safari version (Safari Tech Preview reports typeof WebSocket
as "function').
It is not working for me either.
I've published a new package: 1.4.3 Thanks for the feedback!
@pladaria Looks like the new version didn't make it to npm, the latest version is 1.4.0.
Published again. Sorry for the inconveniences.
Thanks!
Doesn't work for me. Still have the same issue. React-native 0.30.0 and reconnecting-websocket 1.4.3
Published 1.4.4 which fixes WebSocket detection for ReactNative Tested using React Native 0.31.0 (iOS)
Thanks for your feedback
I get a
TypeError: WebSocket constructor not set. Set "options.constructor"
error message in Safari 9.1.2 (11601.7.7) when using browserify 13.1.0 and reconnecting-websocket.Test to reproduce:
browserify -r reconnecting-websocket:websocket > websocket.js
OS I'm using is Mac OS X 10.11.6 (15G31) El Capitan.