TextEncoder undefined on ios deployment
biagioboi opened this issue · 0 comments
I'm trying to release a new JsonLdCredential. As ususal, the JsonLdCredentialFormatService.processCredential()
function is called with the right parameters. On line 212 the call to const result = await w3cCredentialService.verifyCredential(agentContext, { credential });
put in the result the following message {"isValid": false, "validations":{"vcJs":{"isValid": false, "results" :[{"proof ": ..., "verified": false, "error" : {"name": "ReferenceError" , "mess age": "Property 'TextEncoder' doesn't exist", "stack": "ReferenceError: Property 'TextEncoder' doesn't existing at ?anon_0_....}
which is an error caused by the missing TextEncoder from the JSON Parser or from the Signaure Suite. In any case the class TextEncoder doesn't exist on react native deployment.
I've seen multiple solutions to this undefined error from another project by importing text-encoding
or text-encoding-polyfill
but I'm not able to make it work.
Step to reproduce: accept a JsonLdCredential from the wallet with Ed25519Signature2018 proof.
Node.js: v18.18.2
Npm: v9.8.1
Yarn: v3.3.1