You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.
const main = async () => {
const crypto = new (await import('node-webcrypto-ossl')).Crypto();
}
main();
TypeError: (intermediate value).Crypto is not a constructor
NB : I cannot use require() since the library using this is a shared library between front and back, and I make a test on window to determine if I use window.crypto (front) or if I dynamically import node-webcrypto-ossl (server). Plus, ES2020 modules do not support require().
The text was updated successfully, but these errors were encountered:
It's not clear why you've got that exception. I've tried it locally and I don't have such error.
If you are using nodejs version upper then 10 you can use @peculiar/webcrypto module. It based on nodejs crypto API and doesn't require C++ addon.
NB : I cannot use require() since the library using this is a shared library between front and back, and I make a test on window to determine if I use window.crypto (front) or if I dynamically import node-webcrypto-ossl (server). Plus, ES2020 modules do not support require().
The text was updated successfully, but these errors were encountered: