Closed ifzm closed 1 year ago
Why did you closed it and not provide the solution?
The readme claims
Initializer to set up the required ipc communication channels for the module when a Store instance is not created in the main process and you are creating a Store instance in the Electron renderer process only.
But I believed it might be working only under the premise that nodeIntergration
is false
Since electron-store
is merely a wrapper for conf
to make it appropriate for electron, initRenderer
may employ some tricks to make it work properly (possibly only when nodeIntergration
is false
)
So when nodeIntergration
is true
, initRenderer
results in the error Cannot find module "conf"
Because we have turn nodeIntergration
on, there is no longer a requirement for electron-store
, we can utilize conf
directly in renderer process
, and main process
doesn't require any specific imports
you should use
import electronStore from 'electron-store'
instead of using
const electronStore = require('electron-store')
Why did you closed it and not provide the solution?
I have this problem because I use it in the renderer, it should be related to the post-build, I later changed to ipc no problem @irg1008
I use electron-builder to build the package successfully, but this error appears when I run it, what could be the reason? thanks )