question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Webpack + Electron Forge + SQlite3 should work out of the box

See original GitHub issue

Preflight Checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Issue Details

  • Electron Forge Version:
    • 6.0.0-beta.49
  • Electron Version:
    • v7.1.7
  • Operating System:
    • Windows 10 x64

Expected Behavior

Webpack should copy and use the Electron bindings from

node_modules\sqlite3\lib\binding\electron-v7.1-win32-x64\node_sqlite3.node

Actual Behavior

Webpack instead copies the original Node bindings and loads those, giving the usual Error: The module was compiled against a different Node.js version, with the following path:

node_modules\sqlite3\lib\binding\node-v79-win32-x64\node_sqlite3.node

To Reproduce

Configure Forge with webpack (I also use TypeScript), install sqlite3, import it in a script, and run the start script.

Additional Information

None

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
deadcoder0904commented, Apr 26, 2020

@cyril-barragan In case you ever give electron-forge a shot again, then check this out

I found a working solution with electron-forge & better-sqlite3 & correct bindings are used 😃

1reaction
cyril-barragancommented, Apr 11, 2020

Yes I did but no luck either, I even set it as postinstall script. I ended up not using electron-forge and using only electron-webpack with electron-rebuild as postinstall script.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Webpack + Electron Forge + SQlite3 should work out of the box
Configure Forge with webpack (I also use TypeScript), install sqlite3, import it in a script, and run the start script. Additional Information.
Read more >
Integrating Sqlite3 in electron project built with Electron-forge
With this, I was able to run the app and create a database. But when I tried packaging the app, better-sqlite3 was missing...
Read more >
Setting up sqlcipher in an electron app using electron-forge ...
I started a fresh minimal install of electron-forge with Webpack and Typescript template ( npx create-electron-app test-electron-forge-github - ...
Read more >
Installing and rebuilding Sqlite3 for use with Electron - YouTube
Having trouble with a native dependency? Getting a "module not found" on native modules even thought you've just installed them?- Electron ...
Read more >
Need help getting SQLite working with Electron on Windows 10
I have been trying for weeks to get SQLite installed and working with ... I do check the box that says "Automatically install...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found