URL.createObjectURL() function doesn't work in IE 11
Category
- [ ] Question
- [ ] Typo
- [X] Bug
- [ ] Additional article idea
Expected or Desired Behavior
The URL.createObjectURL() function should work in IE 11 on a new modern site page.
Observed Behavior
We use URL.createObjectURL() to load images in our SPFx Web Part. We noticed that the JavaScript function doesn't work in IE 11 (FireFox and Chrome are OK) when the Web Part is placed in the modern site page. A JavaScript error "TypeMismatchError" is thrown. Seems that the error is caused by the SP client page library "sp-pages-assembly_en-us_[guid].js" loaded by the site page. The library provides a new implementation of the URL.createObjectURL() function but IE 11 doesn't like the way it was overridden.
Steps to Reproduce
-
Create a test page which uses the URL.createObjectURL() function to display images. For example, if you can follow the sample below. You should be able to select images and display them in IE 11. https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications#Example_Using_object_URLs_to_display_images
-
Edit the page to load the SP client page library. As of July 31, the URL is "https://spoprod-a.akamaihd.net/files/sp-client-prod_2017-07-14.011/sp-pages-assembly_en-us_b91a3c7aa8341a6dbe6d1f073874c5c4.js". This url could change when Microsoft updates SP Online. You can create a modern site page and find the URL of latest library from the page head.
You will find your page is not working after the SP client library is loaded to the page and see the error in browser's console.
I attached a screenshot and a test html page to reproduce the issue createObj.zip
.
Submission Guidelines
I have merged a fix for this issue. It should roll to production over the next couple weeks. You do not need to upgrade your SPFx packages in order to see the fix.
(If your issue is not resolved after a few weeks, please reopen this bug!)
That's great, thanks Lahuey!
hi @lahuey ,
I am still facing this issue. Can you please confirm if this is merged?
@gargrv I can confirm that fix has been merged. I was also unable to repro the issue in IE11. Could you give me the URL to the pages assembly file that you are running into issues with?
Issue resolved according to MSFT & response by OP so closing issue. If you are still having an issue, please submit a new issue.
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues