My requirement is to zip the content in client side controller using javascript library JSZIP, i have included it as a static resource. Below is the code.
Component:
<aura:component >
<ltng:require scripts="/resource/jszip" afterScriptsLoaded="{!c.onPress}"/>
</aura:component>
Controller:
({
onPress : function(component) {
var packageXml = '<?xml version="1.0" encoding="UTF-8"?>' +
'<Package xmlns="http://soap.sforce.com/2006/04/metadata">' +
'<version>35.0</version>' +
'</Package>' ;
var zipFile = new JSZip();
zipFile.file('package.xml',packageXml,{base64: 'true'});
var data = zipFile.generate();
alert(data);
}
})
I click on Press button, while locker service is enabled I am facing issue and when Locker service disabled the alert is showed as expected (attached the outputs).
Locker service disabled: How to make this work when locker service is enabled. Thank you for help.
The error is very cryptic and not helpful