Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: encodedPayload.split is not a function #1391

Closed
1 task done
vadimka123 opened this issue Nov 6, 2020 · 6 comments
Closed
1 task done

Uncaught TypeError: encodedPayload.split is not a function #1391

vadimka123 opened this issue Nov 6, 2020 · 6 comments
Labels
bug Something isn't working
Milestone

Comments

@vadimka123
Copy link

vadimka123 commented Nov 6, 2020

You want to:

  • report a bug

Current behaviour

Exception: Uncaught TypeError: encodedPayload.split is not a function

Steps to reproduce

Simple polling

Expected behaviour

No exceptions

Setup

  • OS: linux
  • browser: chrome
  • socket.io version: 3.0.0

Other information (e.g. stacktraces, related issues, suggestions how to fix)

Uncaught TypeError: encodedPayload.split is not a function
at Object.decodePayload (index.js?2a85:24)
at XHR.onData (polling.js?0949:105)
at Request.eval (polling-xhr.js?d33e:101)
at Request.Emitter.emit (index.js?7297:145)
at Request.onData (polling-xhr.js?d33e:262)
at Request.onLoad (polling-xhr.js?d33e:329)
at XMLHttpRequest.xhr.onreadystatechange (polling-xhr.js?d33e:217)

@shay-te
Copy link

shay-te commented Nov 6, 2020

also happens to me

@andrewchen30
Copy link

andrewchen30 commented Nov 7, 2020

Me either.

darrachequesne added a commit to socketio/engine.io-client that referenced this issue Nov 8, 2020
Since Engine.IO v4, the binary payloads are always encoded as base64
with the polling transport.

See https://github.com/socketio/engine.io-protocol#difference-between-v3-and-v4

Possibly related: socketio/socket.io-client#1391
@darrachequesne
Copy link
Member

That's weird, the decodePayload() method should always be called with a String...

It might be fixed by socketio/engine.io-client@ec3f677 though.

@darrachequesne darrachequesne added the bug Something isn't working label Nov 8, 2020
@vadimka123
Copy link
Author

@darrachequesne , new exception in 3.0.1 release

Uncaught DOMException: Failed to read the 'responseText' property from 'XMLHttpRequest': The value is only accessible if the object's 'responseType' is '' or 'text' (was 'arraybuffer').

darrachequesne added a commit to socketio/engine.io-client that referenced this issue Nov 17, 2020
The `supportsBinary` attribute and the `forceBase64` option are kept
untouched, though they are not used by the polling transport, which
now always converts the payloads to base64.

Related: socketio/socket.io-client#1391
@TrayserCassa
Copy link

Any workaround for this issue? Currently we are developing a new site, so i could downgrade. For now it should be fine to downgrade, but maybe someone has a better idea?

@darrachequesne
Copy link
Member

This should be fixed by socketio/engine.io-client@ec3f677 and socketio/engine.io-client@89cb771, which are included in engine.io-client@4.0.4 and socket.io-client@3.0.3.

@darrachequesne darrachequesne added this to the 3.0.3 milestone Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants