-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot include tablesort.number #203
Comments
👋 I'm a little confused why you are using both import and require in your JS but my guess is because |
I was having this problem even by including it the way it's supposed to work:
I was able to fix it by adding the following line to the top of tablesort.number.js:
|
It worked for me when using window.Tablesort = require('tablesort');
require('tablesort/src/sorts/tablesort.number');
document.querySelectorAll('table[data-sortable]').forEach((e) => new Tablesort(e)); I don't really like that I have to put it into |
My JS file:
import ('../node_modules/tablesort/src/sorts/tablesort.number');
var Tablesort = require('../node_modules/tablesort/src/tablesort');
new Tablesort(document.getElementById('table-id'));
I get this error:
Uncaught (in promise) ReferenceError: Tablesort is not defined at eval (tablesort.number.js?ea31:16) at eval (tablesort.number.js?ea31:26) at Object.XC2G (0.js:10) at __webpack_require__ (runtime.js:791) at fn (runtime.js:151) at fn.t (runtime.js:195)
The text was updated successfully, but these errors were encountered: