Why cant i require SQLite3 in preload.js?

This is my preload.js file in electron application

window.onload = () => {
  const $ = require('jquery');
  //const sqlite3 = require('sqlite3').verbose();
  //const db = new sqlite3.Database(':memory:');
}

Whenever i try to require sqlite3 in my preload.js file the app crushes.
is there any proper way to add sqlite3 in preload.js file ?