node-keytar icon indicating copy to clipboard operation
node-keytar copied to clipboard

Can't open the app when use Electron + Webpack + keytar

Open xzjcool opened this issue 5 years ago • 3 comments

Description

I use keytar in electron app to store files in keychain, After building and deploying, i open the app on another pc/mac, an error occured and said the keytar's path is an absolute path which depend on the build pc's environment. I tried node-loader and awesome-node-loader in webpack. still can't work. Any suggestion?

Steps to Reproduce

Expected behavior:

Actual behavior:

Reproduces how often:

Versions

Additional Information

xzjcool avatar Jan 16 '20 04:01 xzjcool

I have the same issue.

JasonWang258 avatar Mar 03 '20 19:03 JasonWang258

Try https://www.npmjs.com/package/native-ext-loader

jwonderly avatar Mar 06 '20 13:03 jwonderly

Don't webpack keytar it's a native module. Rather use remote.require("keytar") from your renderer process, if you want to uses that way.

If used with something like electron builder; it will compile and include the node_module package correctly.

smarki avatar Jul 14 '20 13:07 smarki