Search code examples
reactjssqliteelectronsequelize.jsipc

error while running electron app main.ts with sqlite db connection


"pg-hstore" is imported by "pg-hstore?commonjs-external", but could not be resolved – treating it as an external dependency. ✓ 891 modules transformed. dist-electron/main.js 2,899.97 kB │ gzip: 456.42 kB built in 5124ms. App threw an error during load Error: Cannot find module 'pg-hstore' Require stack:

  • /home/chiran/Documents/JEWELLERY PROJECT/Nithyakala_Jewellery_Management_System/application/dist-electron/main.js
  • /home/chiran/Documents/JEWELLERY PROJECT/Nithyakala_Jewellery_Management_System/application/node_modules/electron/dist/resources/default_app.asar/main.js
  • at node:internal/modules/cjs/loader:1084:15 at Function._resolveFilename (node:electron/js2c/browser_init:2:117576) at node:internal/modules/cjs/loader:929:27 at Function._load (node:electron/js2c/asar_bundle:2:13327) at Module.require (node:internal/modules/cjs/loader:1150:19) at require (node:internal/modules/cjs/helpers:110:18) at Object. (/home/chiran/Documents/JEWELLERY PROJECT/Nithyakala_Jewellery_Management_System/application/dist-electron/main.js:10:22) at Module._compile (node:internal/modules/cjs/loader:1271:14) at Object..js (node:internal/modules/cjs/loader:1326:10) at Module.load (node:internal/modules/cjs/loader:1126:32) A JavaScript error occurred in the main process Uncaught Exception: Error: Cannot find module 'pg-hstore' Require stack:
  • /home/chiran/Documents/JEWELLERY PROJECT/Nithyakala_Jewellery_Management_System/application/dist-electron/main.js
  • /home/chiran/Documents/JEWELLERY PROJECT/Nithyakala_Jewellery_Management_System/application/node_modules/electron/dist/resources/default_app.asar/main.js
  • at node:internal/modules/cjs/loader:1084:15 at Function._resolveFilename (node:electron/js2c/browser_init:2:117576) at node:internal/modules/cjs/loader:929:27 at Function._load (node:electron/js2c/asar_bundle:2:13327) at Module.require (node:internal/modules/cjs/loader:1150:19) at require (node:internal/modules/cjs/helpers:110:18) at Object. (/home/chiran/Documents/JEWELLERY PROJECT/Nithyakala_Jewellery_Management_System/application/dist-electron/main.js:10:22) at Module._compile (node:internal/modules/cjs/loader:1271:14) at Object..js (node:internal/modules/cjs/loader:1326:10) at Module.load (node:internal/modules/cjs/loader:1126:32)

I'm trying to create sqlite db with sequelize umzug migrations by calling ipc event in main.js function createWindow(). then comes this errors .


Solution

  • Looks like you need to install the pg-hstore module.

    npm install --save pg-hstore