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

Version 1.6.11 broke <=IE9 support #407

Closed
jameshartig opened this issue Jun 24, 2016 · 3 comments · Fixed by socketio/engine.io-parser#58
Closed

Version 1.6.11 broke <=IE9 support #407

jameshartig opened this issue Jun 24, 2016 · 3 comments · Fixed by socketio/engine.io-parser#58

Comments

@jameshartig
Copy link

It looks like socket.io 1.4.8 broke IE9 and lower becuase they don't have Uint8Array. The only change between 1.4.7 and 1.4.8 in socket.io was an update to engine.io to 1.6.11 which updates ws to 1.1.0 so the problem might actually be related to ws.

The error is 'Uint8Array' is undefined which seems to be coming from:

  // Use a lookup table to find the index.
  var lookup = new Uint8Array(256);

Which is from base64-arraybuffer. That is a engine.io-parser dependency which doesn't seem to be updated in 1.6.11 so it must be the upgrade to ws causing some new code to be running in these browsers.

@tjni
Copy link

tjni commented Jun 26, 2016

What I think happened here is the following:

  1. The code in base64-arraybuffer, since its first commit, uses Uint8Array, so its encode and decode methods did not support IE <= 9. Commit niklasvh/base64-arraybuffer@1616895 lifted the usage of Uint8Array to when the module is required instead of when its methods are called.
  2. socketio/socket.io-client@e97f904 bumped the version of base64-arraybuffer to 0.1.5.
  3. Version 1.4.8 of socket.io-client regenerated the socket.io.js file that is used in the browser to include the breaking change.

As an immediate fix, I suggest pinning the version of base64-arraybuffer to < 0.1.5 and building a new socket.io.js file. Long term, perhaps base64-arraybuffer can be updated to use an array (or a polyfill) when typed arrays are not available.

@tjni
Copy link

tjni commented Jun 26, 2016

Actually, it doesn't make sense to me for base64-arraybuffer to account for browsers that do not support ArrayBuffer. Including it in socket.io.js should be conditional.

@boneskull
Copy link

This has broken our IE8 tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants