Skip to content
Discussion options

You must be logged in to vote

To use NodeJS related packages, u would be in the main process, not in the renderer process.

You had 3 options:

1 - Preload Script - put all your code who requires NodeJS stuff in the preload script, so call them from the renderer process.

https://quasar.dev/quasar-cli-vite/developing-electron-apps/electron-preload-script#introduction

2 - Main Process - put all your code who requires NodeNS in the main process, so use IPC (Main & Renderer) to allow the Renderer Process call the main Process.

https://www.electronjs.org/docs/latest/tutorial/ipc

3 - Browser Friendly DB - use a db library who is browser friendly, like PouchDB, LokiJS, Dexie, etc.

https://dexie.org/
https://github.com/techfort…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@byander
Comment options

Answer selected by byander
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants