Closed mikegillan closed 1 year ago
This shouldn't be needed, @simplewebauthn/iso-webcrypto is a dependency of @simplewebauthn/server from v7.0.0 on, and should get pulled in accordingly. And in fact in example's package-lock.json we can confirm that iso-webcrypto@7.0.0 is present as expected:
https://github.com/MasterKale/SimpleWebAuthn/blob/master/example/package-lock.json#L183-L187
"node_modules/@simplewebauthn/iso-webcrypto": {
"version": "7.0.0",
"resolved": "https://registry.npmjs.org/@simplewebauthn/iso-webcrypto/-/iso-webcrypto-7.0.0.tgz",
"integrity": "sha512-4AatYNU8n1gc9IWTSmkDaVSBE4q4NXBMJbd6adme0mORy2G78SduXsn7eNVpM7y6ptJftUoRJ8KScSRWTr9P6w=="
},
Did you try upgrading your project from an earlier v6 to v7, and maybe something broke down there?
I tried a couple of different ways to install server that might lead to iso-webcrypto not coming along, but both when upgrading from v6 to v7, and removing package-lock.json after installing v7, iso-webcrypto ended up installed.
Thanks for responding. I guess it was a problem with my environment.
I hadn't touched the project in a couple months and saw the big 7.0.0 release (congrats btw!) so I decided to check out a fresh new instance to test the changes. I had an older version of node selected (14.9.0) which generated some version compatibility errors during npm install
so I used nvm to install latest LTS (18.14.2) and tried again. This time it installed successfully but when accessing the page the server threw the error mentioned above.
I've just tried again, re-cloning the project and running npm install
using node 18.14.2 and everything installed and the example ran perfectly with no errors on the first attempt.
Apologies for the unnecessary PR. Shall I close it with a comment, or would you prefer to close / reject it on your side?
Closing as not needed at this moment in time.
The rearchitecture introduced in v7.0.0 (in particular the addition of the isoCrypto helper getRandomValues.ts which leverages WebCrypto), the example project was missing that dependency declaration, which I've added in this PR.
Without the dependency, the server will throw the following TypeError during page load:
Adding the dependency to the example project's package.json resolved the problem.