PeculiarVentures/webcrypto

generatekeypairsync is not a function on Angular 9.14, node 14

StationedInTheField opened this issue · 1 comments

Hey, I'm trying to use your implementation of subtle crypto in a package (https://github.com/QuestNetwork/quest-pubsub-js) to make it portable for use in nodejs and in an angular browser/electron app. Works great for my nodejs test case, but unfortunately the browser/electron app (angular 9) throws the error in title. Any clue what's going on there? If it's a browser related issue, maybe you could test if subtle crypto is available and use that when it's possible instead of your package or should I be doing that in my package (It's what I'm doing right now)? What's your perspective?

PS: Also considered just browserifying but feels kind of ridiculous

@StationedInTheField I added tests for NodeJS v14. All tests passed. It's not clear why you've got that error. It might depend on Electron version you are using. It possible that old version of Elctron includes 'NodeJS::cryptomodule which doesn't implementgeneratekeypairsync` function. We had got a similar problem for our own project (Fortify) and we fixed it by upgrading Electron to the latest version.