-
Notifications
You must be signed in to change notification settings - Fork 135
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 support broken due to emscripten issue #96
Comments
Thanks for not only reporting a problem but also figuring out the solution! I'm currently looking into getting libsass 3.5.0 to work on top of 0.11.0-beta.1 which switches to WebAssembly. Does the IE11 problem also occur in that version? would |
Nevermind… IE11 doesn't like the current WASM build at all :D
|
I discovered the same. :-) IE11 doesn't support native WebAssembly: And running a build from 0.11.0-beta.1 on IE11 results in the following error: It appears that for webasm to work, you'll have to define some alternative binary loading method to support IE11: If the alternative was asm.js, I'd imagine the same LEGACY_VM_SUPPORT flag would apply. |
alright, as 3.5.0 seems to work without a problem I guess it's IE11 time… |
Hey @tomdrewes, sorry for the insane delay. I've added the flag and released 0.10.11. |
Thanks for the fix @rodneyrehm. The change works on my setup, however, the upgrade to emscripten 1.38.12 seems to have added another IE/Edge wrinkle for web workers. I'll just briefly summarize here in case anyone else runs into the issue: The loader for emscripten in sass.worker.js tries to create a "random_device" from which it can summon random numbers. It derives this from the crypto API which comes in various flavors via the window object and for some web workers via self. Unfortunately, IE and Edge do not support crypto (nor the prefixed msCrypto) on web workers (https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/7607496/). In earlier versions of emscripten, it appears the loader would just patch in a pseudo-random number generator (not cryptographically secure, which may have been the reason for changing things in the more recent emscripten release) but in the current version, if it can't find the crypto API, it aborts with a message similar to the following:
As a workaround in my application I am prepending a shim on sass.worker.js for missing crypto which does basically this (some details omitted):
This is, of course, not cryptographically secure, so one should not use this in an application that depends on such properties! I do not see any references to random_device in the rest of the sass.worker.js code, however, so this seems like a reasonably safe approach. |
Thanks @tomdrewes for you fix, but It fix the issue only for Edge and not IE 11. I would like to know if we'll have an official solution for that issue ? (I'm facing too) |
I noticed that I was seeing an "Object expected" error in sass.worker.js when running on IE11. It appears there is an issue in recent versions of emscripten that is causing this:
emscripten-core/emscripten#6204
They cite passing the
-s LEGACY_VM_SUPPORT=1
to emcc as a workaround. I've tested this and it does work. Apparently, there is also an open pull request to incorporate a fix into default emscripten output.Just wondered if in the interim it might make sense to add the LEGACY_VM_SUPPORT flag to libsass/Makefile.patch in order to restore IE11 support.
The text was updated successfully, but these errors were encountered: