iotaledger / identity.rs

Implementation of the Decentralized Identity standards such as DID and Verifiable Credentials by W3C for the IOTA Tangle.
https://www.iota.org
Apache License 2.0
290 stars 83 forks source link

[Task] Investigate Wasm bindgen incompatibility with dockerized Node 22 #1384

Open eike-hass opened 2 weeks ago

eike-hass commented 2 weeks ago

Description

When running resolution through the Wasm bindings in dockerized Node 22 environment, the networks call fail. Dockerized node 21 works, as well as Node 22 locally.

Motivation

Describe the motivation for the feature to be developed.

Resources

Error [JsError]: JavaScript function threw an exception: JsValue("{"type":"error","payload":{"type":"client","error":"node error: error decoding response body: expected value at line 1 column 1"}}"). at module.exports.wbg_new_28c511d9baebfa89 (/usr/src/app/node_modules/@iota/identity-wasm/node/identity_wasm.js:14597:17) at wasm://wasm/00e1eb76:wasm-function[5708]:0x2b0721 at wasm://wasm/00e1eb76:wasm-function[3363]:0x25b5bd at wasm://wasm/00e1eb76:wasm-function[3483]:0x2669f4 at wasm://wasm/00e1eb76:wasm-function[344]:0xc6144 at wasm://wasm/00e1eb76:wasm-function[1015]:0x145445 at wasm://wasm/00e1eb76:wasm-function[4861]:0x29f9c3 at wbg_adapter_32 (/usr/src/app/node_modules/@iota/identity-wasm/node/identity_wasm.js:225:10) at real (/usr/src/app/node_modules/@iota/identity-wasm/node/identity_wasm.js:210:20) at node:internal/process/task_queues:140:7

Node.js v22.3.0


- maybe unrelated, maybe not, but on macOS (14.5, M1) there were errors when running the resolve example (`npm run example:node -- 2_resolve_did`) with v22. Building succeeded on v21 v22, running only worked on v21. On v22 the error below was shown:

![image](https://github.com/iotaledger/identity.rs/assets/1394421/ae31a811-56bf-4de6-8159-a16ec1b4775b)

- as the lock file is checked in, an idea could be to bump our dependencies, e.g. `@digitalbazaar/http-client` from the screenshot is locked to 1.2.0, while current version is 4.1.1. So maybe we could bump that dependency or the dependency, that leads to it a bit; dependency path:

```raw
$ npm why @digitalbazaar/http-client
@digitalbazaar/http-client@1.2.0 dev
node_modules/@digitalbazaar/http-client
  @digitalbazaar/http-client@"^1.1.0" from jsonld@5.2.0
  node_modules/jsonld
    jsonld@"^5.2.0" from jsonld-checker@0.1.8
    node_modules/jsonld-checker
      jsonld-checker@"^0.1.6" from @did-core/did-ld-json@0.1.1-unstable.15
      node_modules/@did-core/did-ld-json
        @did-core/did-ld-json@"^0.1.1-unstable.13" from @transmute/did-key-common@0.3.0-unstable.10
        node_modules/@transmute/did-key-common
          @transmute/did-key-common@"^0.3.0-unstable.9" from @transmute/did-key-ed25519@0.3.0-unstable.9
          node_modules/@transmute/did-key-ed25519
            dev @transmute/did-key-ed25519@"0.3.0-unstable.9" from the root project

To-do list

Create a task-specific to-do list. Please link PRs that match the TODO list item behind the item after it has been submitted.

Change checklist

Add an x to the boxes that are relevant to your changes, and delete any items that are not.

eike-hass commented 2 weeks ago

Likely ultimately caused by https://github.com/iotaledger/iota-sdk/issues/2254