DataTable.ext.buttons Namespace Missing
DataTable.ext.buttons Namespace Missing
Error messages shown:
C:\ESBUILD>node DataTables_01.mjs
file:///C:/ccccccc/node_modules/datatables.net-buttons/js/buttons.colVis.mjs:14
$.extend(DataTable.ext.buttons, {
^
TypeError: Cannot read properties of undefined (reading 'buttons')
at file:///C:/ESBUILD/node_modules/datatables.net-buttons/js/buttons.colVis.mjs:14:24
at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:337:24)
at async loadESM (node:internal/process/esm_loader:34:7)
at async handleMainPromise (node:internal/modules/run_main:106:12)
Node.js v18.20.2
Description of problem:
I am trying to get the following code to work:
import * as esbuild from 'esbuild';
import * as jQuery from "jquery";
import * as jszip from 'jszip';
import * as pdfmake from 'pdfmake';
import * as DataTable from 'datatables.net-bs';
import 'datatables.net-buttons-bs';
import 'datatables.net-buttons/js/buttons.colVis.mjs';
import 'datatables.net-buttons/js/buttons.html5.mjs';
import 'datatables.net-buttons/js/buttons.print.mjs';
I have run the following installs:
npm install --save jquery
npm install --save jszip
npm install --save pdfmake
npm install --save datatables.net-bs
npm install --save datatables.net-buttons-bs
What do I need to do to resolve the error?