I'm trying to fix some console errors in a Rails 6 + Webpack app, and even though after the change I restart the server, the changes don't seem to be saved.
For example, I get this error:
datatables.js:32 Uncaught TypeError: Cannot read property 'isDataTable' of undefined
at HTMLDocument.<anonymous> (datatables.js:32)
at HTMLDocument.dispatch (jquery.js:4588)
at HTMLDocument.elemData.handle (jquery.js:4408)
at Object../node_modules/turbolinks/dist/turbolinks.js.e.dispatch (turbolinks.js:75)
at r.notifyApplicationAfterPageLoad (turbolinks.js:994)
at r.pageLoaded (turbolinks.js:948)
at turbolinks.js:872
To fix it, I changed the offending line to:
$(document).on('turbolinks:load', function() {
if (!$.fn.dataTable.isDataTable("table")) {
$("table").DataTable();
}
});
I restarted the server, even the browser and the entire computer (just in case), but the error is still there. When I go to sources, it appears as though I haven't changed the code but in the editor I see the updated version. This happens with every change I make, I guess I'm missing something obvious.
Thanks for your help!