I've been trying to set-up a working Electron application using Electron Forge with Sqlite3 and Sequelize. This has worked great up until where I need to actually build and package, and distribute the application. When I click to start the executable, on both Windows and MacOS, I get the following error:
A JavaScript error occurred in the main process
Uncaught Exception:
Error: Please install sqlite package manually
at z._loadDialectModule (/Users/evilscaught/Documents/e-tabulator/out/e-tabulator-darwin-arm64/e-tabulator.app/Contents/Resources/ app.asar/.webpack/main/index.js:2:1038558)
at new z (Users/evilscaught/Documents/e-tabulator/out/e-tabulator-darwin-arm64/e-tabulator.app/Contents/Resources/app.asar/.webpack/main/ index.js:2:1122797)
at new b (/Users/evilscaught/Documents/e-tabulator/out/e-tabulator-darwin-arm64/e-tabulator.app/Contents/Resources/app.asar/webpack/main/ index.js:2:1584623)
at new P (/Users/evilscaught/Documents/e-tabulator/out/e-tabulator-darwin-arm64/e-tabulator.app/Contents/Resources/app.asar/.webpack/main/ index.js:2:1160959)
at 9678 (/Users/evilscaught/Documents/e-tabulator/out/e-tabulator-darwin-arm64/e-tabulator.app/Contents/Resources/app.asar/.webpack/main/ index.js:2:1696966)
at o /Users/evilscaught/Documents/e-tabulator/out/e-tabulator-darwin-arm64/e-tabulator.app/Contents/Resources/app.asar/.webpack/main/ index.js:2:1729848)
at 4934 (/Users/evilscaught/Documents/e-tabulator/out/e-tabulator-darwin-arm64/e-tabulator.app/Contents/Resources/app.asar/.webpack/main/ index.js:2:1281401)
at o /Users/evilscaught/Documents/e-tabulator/out/e-tabulator-darwin-arm64/e-tabulator.app/Contents/Resources/app.asar/.webpack/main/ index.js:2:1729848)
at 629 (/Users/evilscaught/Documents/e-tabulator/out/e-tabulator-darwin-arm64/e-tabulator.app/Contents/Resources/app.asar/webpack/main/ index.js:2:132916)
at o /Users/evilscaught/Documents/e-tabulator/out/e-tabulator-darwin-arm64/e-tabulator.app/Contents/Resources/app.asar/.webpack/main/ index.js:2:1729848)
I've created a repository with complete instructions and pictures on how to reproduce this error, if anyone has an approach on how to fix this problem I would be eternally grateful!
After digging around relentlessly, I've been able to come up with a solution, many thanks to a chap on GitHub who published the following npm package electron-forge-plugin-dependencies.
Instead of installing the npm package, I've decided to manually add the code into my project. Pasting the solution in here would make for an answer far too long, so please refer to these changes I've made in the repository linked in my original question. I will keep this repository up until the end days for anyone that might wish to use it as a starting point for an electron application built using forge with SQLite3 and sequelizer.