Closed juanmartin closed 2 years ago
UPDATE:
Fixed my own issue.
The problem was that I was calling asynchronously to get the storage path from the main process, so the module was initialized before having the path set. I switched to ipcRenderer.sendSync
and was able to make it work.
I realized about this because one of the things I tried was to hardcode the path, and it worked.
Leaving this here for future reference. Thanks!
Glad you got it solved!
Hi, I've just updated Electron to latest v14.0.1 and can't set the data path. I always get the
Error: You must explicitly set a data path
.This is my config for the main Window:
I've used
storage.setDataPath(storagePath);
where I pass thestoragePath
through IPC to the renderer process. Also tried setting the data path in the main process, but still get the error. Callingstorage.getDefaultDataPath()
returnsnull
Callingstorage.getDataPath()
returns the set path.I've migrated the project to use '@electron/remote' as it has been fully deprecated.
Let me know what other info can I provide to help debug this.
Thank you in advance!