Closed kansson closed 1 year ago
I'm pretty sure this is an ESM environment issue. Right now only CommonJS (read: Node) runtimes are officially supported by @simplewebauthn/server.
That said #338 has been tracking my efforts to add support for use of SimpleWebAuthn in ESM environments. There's no ETA right now as I work on that particular problem when I have time.
I'm pretty sure this is an ESM environment issue. Right now only CommonJS (read: Node) runtimes are officially supported by @simplewebauthn/server.
That said #338 has been tracking my efforts to add support for use of SimpleWebAuthn in ESM environments. There's no ETA right now as I work on that particular problem when I have time.
Understood!
The server package does work in edge environments like Cloudflare Workers. Probably due to the new Node compatibility mode https://blog.cloudflare.com/workers-node-js-asynclocalstorage.
Reverted moduleResolution
: nodenext
until the ESM support has fully landed.
Feel free to close this in favour of #338.
As acknowledged, closing as a dupe of #338 ✌️
Describe the issue
No types are recognized when importing any functions from either the server or client packages when
moduleResolution
is set tonodenext
intsconfig.json
. Installing the separate types package does not solve the issue.Reproduction Steps
moduleResolution
tonodenext
Expected behavior
The types should be recognized as expected with this setting.
Dependencies
SimpleWebAuthn Libraries
Using the latest version of both packages.
Additional context
Not sure why this is happening, tried looking into it but couldn't figure it out. Some info of the setting: https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#esm-nodejs