function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pavel NavratilPavel Navratil 

createObjectURL - A Component Error has occurred!

Hi,
I'm working on a custom picture resize before uploading to Salesforce. I'm receiving an error after update od Sprint 19. 
error message
The issue is in this line:
img.src = _URL.createObjectURL(file);
Not sure exactly where is an issue.

The whole code is here:
var _URL = window.URL;
        var img = new Image(),
        resizeWidth = 2000,
        quality = 0.5;
        img.src = _URL.createObjectURL(file);
        img.onload = function () {
            var cvs = document.createElement('canvas');
            var resizeRatio = img.width / resizeWidth;
            cvs.width = img.width / resizeRatio;
            cvs.height = img.height / resizeRatio;
            var ctx = cvs.getContext("2d").drawImage(img, 0, 0, (img.width), (img.height), 0, 0, (img.width / resizeRatio), (img.height / resizeRatio));
            var newImageData = cvs.toDataURL('image/jpeg', quality);
            var base64 = 'base64,';
            var dataStart = newImageData.indexOf(base64) + base64.length;
            var fileContents = newImageData.substring(dataStart);
            self.uploadProcess(component, file, fileContents);
        }
Thank you for help.
Naveen KNNaveen KN
Hi Pavel, If you are seeing this error post spring'19 update, I would recommend to raise a case with salesforce support team https://help.salesforce.com/login
Brandon Coston 15Brandon Coston 15
I'm definitely seeing this same issue.  I opened a case and they just told me to post to the developer forums about it :(