Closed PawelDmochowski closed 1 year ago
Thanks for the report @PawelDmochowski. Whoops, I see the issue: I used require()
when I attempt to dynamically import Node's crypto module instead of import()
. 🤦♂️
PR #428 will fix this problem.
Gosh, you're fast! 😄
@PawelDmochowski This should be fixed in the newly published @simplewebauthn/server@8.0.1
✌️
Describe the issue
Using @simplewebauthn/server@8.0.0 in ESM throws exception
require is not defined
when executingawait generateRegistrationOptions()
.Reproduction Steps
Import library in project with
{ "type": "module" }
, executeawait generateRegistrationOptions()
.Expected behavior
The function should not throw
MissingWebCrypto
since "node:crypto" is available.Code Samples + WebAuthn Options and Responses
The issue can be tracked to line 16 of
@simplewebauthn\server\esm\helpers\iso\isoCrypto\getWebCrypto.js
which usesrequire
.Dependencies
SimpleWebAuthn Libraries version 8.0.0
Additional context