DataTable Export, only CSV works

Hello,
I am attempting to implement DataTable export functionality in my TypeScript Electron desktop application. The application functions in an offline state, so I need to be able to export without accessing the webix CDN. I found the following:

The dependencies which are used for providing export possibilities are generally taken from Webix CDN online catalog. If you need to implement data export offline, you should complete the following steps:

download the package with CDN-files from https://github.com/webix-hub/cdn-extras

rename the folder to "extras" and move it to the desired directory
set the path to the local CDN repository as: `webix.cdn = "/local_folder";`

Per this, I downloaded the CDN, renamed it extras, and moved it into my local directory:
C:\\Dev\\Projects\\Electron\\app\\client\\components\\controls\\table\\extras

CSV export works great, however none of the other exports work. I will post the code below, as well as the error messages.

import "webix";
import "webix/webix.css";
import "webix/webix.js";

// we downloaded some files webix tries to get, so that we can retrieve these offline
(webix as any).cdn = "../components/controls/table";

export class WebixTableStore
{

...

protected createOptions ()
   {
      const columns = this.createColumnHeaders ();
      const data    = this.createData ();
      const rules   = this.createRules ();

      return {
         autoheight: true,
         autowidth: true,
         blockselect: true,
         columns,
         container: this.renderingNodeId,
         data,
         editable: true,
         editaction: "dblclick",
         id: this.renderingNodeId,
         multiselect: true,
         navigation: true,
         rules,
         select: "cell",
         view: "datatable",
         ready ()
         {
            const target = this as any;
            target.validate ();
         },
      } as webix.ui.datatableConfig;
   }

   protected createTableWhenReady = () =>
   {
      this.table = (window as any).webix.ui (this.createOptions ()) as webix.ui.datatable; // any is because TS def is wrong
   }

protected createTable ()
   {
      webix.ready (this.createTableWhenReady);
   }

exportExcel = () =>
   {
      if (this.table)
      {
         webix.toExcel (this.renderingNodeId, {});
      }
   }

   exportCSV = () =>
   {
      if (this.table)
      {
         webix.toCSV (this.renderingNodeId, {});
      }
   }

   exportPDF = () =>
   {
      if (this.table)
      {
         webix.toPDF (this.renderingNodeId, "name");
      }
   }

   exportPNG = () =>
   {
      if (this.table)
      {
         webix.toPNG (this.renderingNodeId, "name");
      }
   }
...
}

when exporting to excel:

Uncaught Error: Cannot find module './dist/cpexcel'
    at Module._resolveFilename (module.js:470)
    at Function.Module._resolveFilename (C:\\Dev\\Projects\\Electron\\app\\client\
ode_modules\\electron\\dist\\resources\\electron.asar\\common\\res…:35)
    at Function.Module._load (module.js:418)
    at Module.require (module.js:498)
    at require (internal/module.js:20)
    at make_xlsx (eval at webix.exec (webix.js?ca2c:1805), <anonymous>:5:15473)
    at eval (eval at webix.exec (webix.js?ca2c:1805), <anonymous>:15:9597)
    at eval (<anonymous>)
    at Object.webix.exec (webix.js?ca2c:16)
    at webix.ajax.eval (webix.js?ca2c:15)

when exporting to PDF: (notice it is missing the client folder in the path?)

GET file:///C:/Dev/Projects/Electron/app/components/controls/table/extras/undefined.ttf net::ERR_FILE_NOT_FOUND

when exporting to PNG:

Uncaught TypeError: Cannot read property 'polyfill' of undefined
    at Object.eval (eval at webix.exec (webix.js?ca2c:1805), <anonymous>:7:25235)
    at eval (eval at webix.exec (webix.js?ca2c:1805), <anonymous>:8:26504)
    at eval (<anonymous>)
    at Object.webix.exec (webix.js?ca2c:16)
    at webix.ajax.eval (webix.js?ca2c:15)
    at Function.webix.ajax.$callback (webix.js?ca2c:130)
    at XMLHttpRequest.G.a.onreadystatechange (webix.js?ca2c:125)

Any suggestions?

try to set cdn as absolute path uri, not relative.
like that: file:///c:/path/to/cdn

i did:

(webix as any).cdn =`file:///C:/Dev/Projects/Electron/app/client/components/controls/table`;

export to Excel:
Uncaught Error: Cannot find module './dist/cpexcel'

export to PDF:
GET file:///C:/Dev/Projects/Electron/app/client/components/controls/table/extras/undefined.ttf net::ERR_FILE_NOT_FOUND

export to PNG:
Uncaught TypeError: Cannot read property 'polyfill' of undefined

so basically no difference :neutral:

this is a screenshot of my directory to show the path does exist…

I would suggest to run simple http server (like zervit or mongoose). just one click more, but I think you will not have these problems.

One possible workaround is to enable the dynamic script loading feature

include next files directly into the HTML page

<script src="/extras/xlsx.core.styles.min.js"></script>
<script src="/extras/pdfjs.js"></script>

in js code, after webix.js loading

webix.require.disabled = true;

As result, the library will not try to load anything dynamically, and loading related errors must not occur anymore.