atom / node-keytar

Native Password Node Module
https://atom.github.io/node-keytar
MIT License
1.37k stars 193 forks source link

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

Open xzjcool opened 4 years ago

xzjcool commented 4 years ago

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

JasonWang258 commented 4 years ago

I have the same issue.

jwonderly commented 4 years ago

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

smarki commented 4 years ago

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.