Kiano Jajino
Kiano Jajino4w ago

Try to use node-opcua-client (npm) with Deno but struggle

Hello, I want to try to migrate a little app to Deno because the compile option suit my need and that now it support npm package. I want to use the npm package node-opcua-client but I've got this error message
error: Uncaught (in promise) DataError: 'key_ops' property of JsonWebKey is invalid
at importKeyRSA (ext:deno_crypto/00_crypto.js:3849:17)
at importKeyInner (ext:deno_crypto/00_crypto.js:3585:14)
at SubtleCrypto.importKey (ext:deno_crypto/00_crypto.js:989:26)
at buildPublicKey (file:///D:/Code/DenoTest/node_modules/.deno/node-opcua-crypto@4.12.0/node_modules/node-opcua-crypto/dist/index.js:2026:42)
at eventLoopTick (ext:core/01_core.js:175:7)
at async createSelfSignedCertificate (file:///D:/Code/DenoTest/node_modules/.deno/node-opcua-crypto@4.12.0/node_modules/node-opcua-crypto/dist/index.js:6203:21)
error: Uncaught (in promise) DataError: 'key_ops' property of JsonWebKey is invalid
at importKeyRSA (ext:deno_crypto/00_crypto.js:3849:17)
at importKeyInner (ext:deno_crypto/00_crypto.js:3585:14)
at SubtleCrypto.importKey (ext:deno_crypto/00_crypto.js:989:26)
at buildPublicKey (file:///D:/Code/DenoTest/node_modules/.deno/node-opcua-crypto@4.12.0/node_modules/node-opcua-crypto/dist/index.js:2026:42)
at eventLoopTick (ext:core/01_core.js:175:7)
at async createSelfSignedCertificate (file:///D:/Code/DenoTest/node_modules/.deno/node-opcua-crypto@4.12.0/node_modules/node-opcua-crypto/dist/index.js:6203:21)
NodeOPCUA creates automatically a default certificate when a client is first started. But my guess is either the symlink deno create for node_modules cause the issues or a permission missing but I already run the project using -A. I don't have this with Node Can you help me troubleshooting this ?
3 Replies
bartlomieju
bartlomieju4w ago
That seems like an internal bug in Deno. I would appreciate if you could open an issue in Github with reproeuction
Kiano Jajino
Kiano JajinoOP4w ago
Thanks for your response, here is it --> https://github.com/denoland/deno/issues/26870
GitHub
node-opcua-client (npm) with Deno · Issue #26870 · denoland/deno
Version: deno 2.0.6 (stable, release, x86_64-pc-windows-msvc) Hello, I want to try to migrate a little app to Deno because the compile option suit my need and that now it support npm package. I wan...
bartlomieju
bartlomieju4w ago
Thanks!