sp-dev-docs icon indicating copy to clipboard operation
sp-dev-docs copied to clipboard

URL.createObjectURL() function doesn't work in IE 11

Open matthong opened this issue 9 years ago • 6 comments

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

  1. 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

  2. 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

typemismatcherror

.

Submission Guidelines

matthong avatar Jul 31 '17 15:07 matthong

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!)

ghost avatar Aug 03 '17 21:08 ghost

That's great, thanks Lahuey!

matthong avatar Aug 03 '17 21:08 matthong

hi @lahuey ,

I am still facing this issue. Can you please confirm if this is merged?

gargrv avatar Jan 09 '18 10:01 gargrv

@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?

ghost avatar Jan 11 '18 01:01 ghost

Issue resolved according to MSFT & response by OP so closing issue. If you are still having an issue, please submit a new issue.

andrewconnell avatar Aug 09 '19 19:08 andrewconnell

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

msft-github-bot avatar Jan 29 '20 06:01 msft-github-bot