Closed qertis closed 1 year ago
Hi @qertis, Try the DCC fork of this library (we've modified it for TypeScript compatibility): https://github.com/digitalcredentials/ed25519-verification-key-2020
Ok, but doesn't work after init.
...
"dependencies": {
"@digitalcredentials/ed25519-verification-key-2020": "github:digitalcredentials/ed25519-verification-key-2020"
}
...
[Error] Unhandled Promise Rejection: TypeError: undefined is not an object (evaluating 'crypto.web.subtle.digest')
Where does crypto.web.subtle.digest
come from? It would normally be crypto.subtle.digest
in browsers, and crypto.webcrypto.subtle.digest
or crypto.subtle.digest
in Node.js (depending on your version).
Can you please guide me on how to fix these issues?
We use standard ECMAScript/JavaScript everywhere, and support modern Node.js and browser APIs, so the incompatibilities are likely minimal once TypeScript related tooling understands modern ECMAScript like ESM and similar. We don't have the time and resources to find workarounds for TypeScript tool problems but would appreciate non-invasive patches that fix compatibility issues.
Ok, but doesn't work after init.
... "dependencies": { "@digitalcredentials/ed25519-verification-key-2020": "github:digitalcredentials/ed25519-verification-key-2020" } ...
I don't know how their fork works, but I think it has a build step, so maybe I suggest trying the published npm version. You should probably ask questions about their fork in their repo.
Okay, thank you for the response. I rolled back to your version without TypeScript, as it is more stable.
I noticed that you are using JSDoc. Have you considered converting your annotations to .d.ts files using automated conversion tools like tsd-jsdoc? They might also help catch errors in your JSDoc annotations.
@dmitrizagidulin may be interested in fixing stability issues of their fork.
We don't use TypeScript so probably won't include ts related files or tooling in our process. Sorry about that. We are aware people use those type definitions. I think our hope is that someone else, human or robot, will maintain those in the 3rd party repos of type definitions.
In case you're wondering, we will likely support type defs and similar once they are standardized enough that the tech works natively in browsers and Node.js. That seems to be taking a long time though. Transpiling code and keeping complex toolchains up-to-date on many hundreds of packages is difficult otherwise.
Do we have jsdoc annotation errors? Likely... please report issues if you fine problems.
Thank you for discussion
When initializing my TypeScript project, I encountered an error while using the following import statement:
The error message displayed is:
To resolve this error, I tried to use
@ts-ignore
while running the following code:But now in browser (Safari, FF) I am encountering a new error:
Can you please guide me on how to fix these issues?