Skip to content

TextEncoder undefined on ios deployment #1156

@biagioboi

Description

@biagioboi

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.

Screenshot 2024-06-08 alle 23 37 13

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleThis issue has gone stale.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions