Note: that this error happens on a fully functional product (production codebase).
This happened after upgrading Chrome to Version "119.0.6045.159".
I’ve also tried my code on Chromium too, after upgrading it to "121.0.6151.0"
EXAMPLE:
...
// The Database class ctor definition:
RDatabase()
{
const SCHEMA = 'CREATE TABLE IF NOT EXISTS trajPnts(...);';
...
const PRESTM = 'INSERT INTO trajPnts(x1,x2,x3,...) VALUES(?,?,?,...);';
try
{
this.db = openDatabase(...);
this.createSchema = function ()
{
...
}
this.insertData = function (traj) // <--- THE "insertData" METHOD !!!
{
...
}
this.createSchema();
}
catch(e)
{
...
}
}
...
// Create a Database instance:
var dbr = new RDatabase();
// Register a handler to record incoming data:
Handler.RegisterTrajHandler(
function(traj)
{
dbr.insertData(traj);
}
);
...
Uncaught TypeError: insertData is not a function
2
Answers
As pointed out by Yogi in the comments, this is likely to do with the fact that the Web SQL standard has been deprecated for a long while and is finally removed in Chromium 119.
The issue is obscured by the
try/catch
in your original code; sinceopenDatabase
fails (presumably "openDatabase is not defined" or similar), thethis.createSchema
andthis.insertData
functions never get defined either:If you still need the SQLite API going forward, you will need to migrate to e.g. this SQLite WebAssembly port (linked in the aforementioned blog post as a recommendation by the Chrome team).
Originally posted into the question by the OP. Revision history