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

IE11: 'Uint8ClampedArray' is undefined #11440

Closed
4 of 13 tasks
luruke opened this issue Jun 3, 2017 · 8 comments
Closed
4 of 13 tasks

IE11: 'Uint8ClampedArray' is undefined #11440

luruke opened this issue Jun 3, 2017 · 8 comments

Comments

@luruke
Copy link
Contributor

luruke commented Jun 3, 2017

Hello, starting from r85 threejs seems broken on IE11 (via browserstack at least).

The problems seems to be here:

Uint8ClampedArray: Uint8ClampedArray,

screen shot 2017-06-03 at 16 44 32

Anyone has the same problem?

Three.js version
  • Dev
  • r85
  • r84
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
@luruke
Copy link
Contributor Author

luruke commented Jun 3, 2017

Apparently the support for Uint8ClampedArray as been introduced in the build KB2929437 from microsoft: https://support.microsoft.com/en-us/help/2929437/description-of-the-security-update-for-internet-explorer-11-on-windows-7-and-windows-server-2008-r2-april-8,-2014

That means that the bug should be reproduced just in older build of IE11.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 3, 2017

I'm not convinced it is appropriate to provide a fix here. The mentioned IE11 update is from 2014, right? That's pretty old. I think users need to upgrade their browser if they actually run into this problem.

@luruke Is this possible in your case?

BTW: We also use Uint8ClampedArray in src/core/BufferAttribute.js.

@luruke
Copy link
Contributor Author

luruke commented Jun 3, 2017

Hello @Mugen87.

I'm ok to not support older build of IE11 , but at least we should add a check, in order to avoid to break all the javascript in the page.

Worth mentioning is that to reproduce the bug, is enough to load three js, even without using it.
So it's impossible "exit gracefully", if not loading the library dinamically.

Strangely enough, when I tried, the r84 seemed to work. Any idea why?

@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 3, 2017

I think because of 43d6053

Before this change, the variable TYPED_ARRAYS was only created if the .parse() method of BufferGeometryLoader was called.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 3, 2017

Worth mentioning is that to reproduce the bug, is enough to load three js, even without using it.

@luruke Was not aware about that. Any ideas how to improve the situation? Unfortunately, i'm unable to test and reproduce this on my machine.

@luruke
Copy link
Contributor Author

luruke commented Jun 3, 2017

@Mugen87 I'm using BrowserStack to replicate the issue.
More specifically the configuration is called (windows 8.1 - ie11 latest).
(Not sure if you can use a trial account).

I'm more than happy to create a pull request.

What about a simple:

Uint8ClampedArray: typeof Uint8ClampedArray !== 'undefined' ? Uint8ClampedArray : Uint8Array,

Or it's better to move back the TYPED_ARRAYS inside .parse() ?
(of course it will mean fatal error when using it).

What I want for the moment is just make sure that the JavaScript code is correctly parsed, so I can gracefully degrade (aka not running the webgl part) on my website when running on IE11 (or when Uint8ClampedArray not available).

BTW this is not the only problem with this old IE11 build:

screen shot 2017-06-03 at 20 35 08

screen shot 2017-06-03 at 20 38 02

screen shot 2017-06-03 at 20 38 08

As you can see webgl is supported, the basic cube spinning is not working with r84, while an old demo r55 is working. In any case this is not my biggest concern, also considering that on browserstack windows is probably running on very limited video card / old drivers.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 4, 2017

Before creating a PR, i'd like to wait what other developers say about this issue.

Besides, i've made bad experiences with testing graphic intensive applications in VMs. They sometimes report errors or warnings that don't occur on physical machines.

@mrdoob
Copy link
Owner

mrdoob commented Jun 6, 2017

What about a simple:

Uint8ClampedArray: typeof Uint8ClampedArray !== 'undefined' ? Uint8ClampedArray : Uint8Array,

That sounds like an okay workaround to me.

luruke added a commit to luruke/three.js that referenced this issue Jun 7, 2017
@mrdoob mrdoob closed this as completed Jun 8, 2017
mrdoob added a commit that referenced this issue Jun 8, 2017
@mrdoob mrdoob added Bug and removed Bug (easy) labels Mar 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants