Author Topic: This method has been removed in JSZip 3.0, please check the upgrade guide.  (Read 3246 times)

mscodigno

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 24
    • View Profile
Hello, I want to get excel output locally, but I get the following error;
 - Uncaught Error: This method has been removed in JSZip 3.0, please check the upgrade guide. -> datatables.bundle.js:15556

The error appears in the DataTable script, DataTable is used on every page.
How can I solve this problem?

Code: [Select]
{
    type: 'button',
    label: "Export",
    icon: 'ui-icon-arrowthickstop-1-s',
    listener: function() {

        var format = $("#export_format").val(),
            blob = this.exportData({
                format: format,
                nopqdata: true,                       
                render: true
            });
        if (typeof blob === "string") {
            blob = new Blob([blob]);
        }
        saveAs(blob, "pqGrid." + format);
    }
}

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Please use jszip version 2.5.0

mscodigno

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 24
    • View Profile
I am already using version 2.5.0. Even if I uninstall JSZip and FileSaver scripts I get the same error. Could it be conflicting with the DataTable?

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
Please share a jsfiddle or stackblitz so that I can check it.

mscodigno

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 24
    • View Profile
https://jsfiddle.net/zekeriyaerogluu/akLpovb6/7/

Note: I am getting this error only in Excel option. I can export with html, json and csv.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
your jsfiddle is incomplete and doesn't reproduce the error. Do you get the error if third party library files ( datatable ) are removed.

Please share a complete test case with reproducible error if still facing error.
« Last Edit: March 04, 2021, 04:07:24 pm by paramvir »

mscodigno

  • Pro Deluxe
  • Newbie
  • *
  • Posts: 24
    • View Profile
When I remove the datatables.bundle.js file, there is no problem, but I have no possibility to remove it because it is used in the project's general scripts. Is there any way to avoid this conflict?
« Last Edit: March 04, 2021, 04:55:31 pm by mscodigno »

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6310
    • View Profile
It's difficult to comment on resolution of conflict without looking into it.

So please share a complete test case on jsfiddle with reproducible error.