Closed TauPan closed 4 years ago
I just upgraded to beta.40 by hand (28 is available on yarn, so I preferred that earlier) and can reproduce the behaviour there as well.
In fact, the error disappears when I remove the render function.
Uhm, when I reinstall (beta 28 or 40, doesn't matter) this behaviour disappears. Maybe I had the wrong beta (possibly 5, from npm) installed here.
Ugh, it just reappeared again, unfortunately. I'll see what actually reproduces this on my part.
testcafe reproduces this reliably, but I've seen this error in the actual browser console as well... still investigating...
(I hope you don't mind if I'm keeping notes on this closed issue. I'll reopen it when I'm sure that it's a bug in yadcf as opposed to my own code or testcafe. Testcafe is probably out of the picture because I could at some point reproduce it in the browser by hand.)
Firefox (Quantum 68.4.2esr (64-Bit)) gives a different error (the above was with chromium ( 80.0.3987.87 (openSUSE Build) (64-Bit))):
JavaScript error details:
oTable.fnSettings(...).oLoadedState is null:
saveTextKeyUpState@http://127.0.0.1:8003/airshield/static/js/airshield.bundle.js:40200:68
keyUp@http://127.0.0.1:8003/airshield/static/js/airshield.bundle.js:40186:5
textKeyUP/<@http://127.0.0.1:8003/airshield/static/js/airshield.bundle.js:40194:6
airshield</</</yadcf</yadcfDelay</</timer<@http://127.0.0.1:8003/airshield/static/js/airshield.bundle.js:36860:6
I think that's because firefox doesn't correctly parse the source-map (no idea why). From the line numbers, it looks like it's this function:
function saveTextKeyUpState(oTable, table_selector_jq_friendly, column_number, regex_check_box, null_checked, exclude) {
if (oTable.fnSettings().oFeatures.bStateSave === true && oTable.fnSettings().oLoadedState.yadcfState) {
if (oTable.fnSettings().oLoadedState.yadcfState !== undefined && oTable.fnSettings().oLoadedState.yadcfState[table_selector_jq_friendly] !== undefined) {
oTable.fnSettings().oLoadedState.yadcfState[table_selector_jq_friendly][column_number] = {
regex_check_box: regex_check_box,
null_checked: null_checked,
exclude_checked: exclude
};
} else {
yadcfState = {};
yadcfState[table_selector_jq_friendly] = [];
yadcfState[table_selector_jq_friendly][column_number] = {
regex_check_box: regex_check_box,
exclude_checked: exclude,
null_checked: null_checked
};
oTable.fnSettings().oLoadedState.yadcfState = yadcfState;
}
oTable.fnSettings().oApi._fnSaveState(oTable.fnSettings());
}
}
The problem in chromium is in the same line of code, the phrasing is just different
JavaScript error details:
TypeError: Cannot read property 'yadcfState' of null
at saveTextKeyUpState (http://127.0.0.1:8003/airshield/static/js/airshield.bundle.js:40200:93)
at keyUp (http://127.0.0.1:8003/airshield/static/js/airshield.bundle.js:40186:5)
at http://127.0.0.1:8003/airshield/static/js/airshield.bundle.js:40194:6
at http://127.0.0.1:8003/airshield/static/js/airshield.bundle.js:36860:6
So for some reason oTable.fnSettings()
returns a null value. Edit: Actually, just oLoadedState
is null in the returned object.
From the way it behaves (sometimes the error is thrown after the click, sometimes on keyboard input) I would suspect it's related to timing.
I'm confused now. fnSettings
is legacy Datatables api isn't it? There's a function getSettingsObjFromTable
which smartly dispatches to get the right thing, but in several parts of the code, fnSettings is still used.
I'm using datatables 1.10.19 (could try upgrading to 1.10.20 if that helps).
(Not sure that this is a bug in yadcf yet, but maybe you can clarify things.)
I'm using datatables 1.10.19 (could try upgrading to 1.10.20 if that helps).
Unfortunately the minor datatables upgrade does not help.
I see the following with 0.9.4-beta.28 (via yarn).
This happens when I type into a column search field.
This is defined as:
Not sure if relevant, the datatables column has a render property:
Sorry, if this is not a bug in yadcf.