-
-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Description
When imported in an NPM package context as instructed in https://datatables.net/download/npm#ES-module-loader:
import DataTable from 'datatables.net-bs5'
import 'datatables.net-responsive-bs5'
this line https://github.com/DataTables/Responsive/blob/3.0.0/js/responsive.bootstrap5.js#L5 fails due to error:
Uncaught TypeError: dataTables_bootstrap5_default.Responsive is undefined
mjs responsive.bootstrap5.mjs:13
__init app.js:38
js TransactionsTable.js:2
__init app.js:38
js index.js:1
__require app.js:41
<anonymous> app.js:42837
<anonymous> app.js:42838
My guess is that this is because here:
https://github.com/DataTables/Responsive/blob/3.0.0/js/dataTables.responsive.js#L1719
Responsive is only added to $.fn.DataTable and $.fn.dataTable, but not to DataTable and that this may work in a global browser window context somehow, but fails when using an ESM bundler.
I have not tested extensively but this issue may also be present for other integrations
Metadata
Metadata
Assignees
Labels
No labels