decentralized-identity / did-jwt-vc

Create and verify W3C Verifiable Credentials and Presentations in JWT format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] update of uint8arrays in did-jwt breaks multiple projects

nklomp opened this issue ยท comments

IMO a new major version should have been released for did-jwt-vc when the move to ESM was made for did-jwt.
The latest update to did-jwt is including a newer uint8arrays that now breaks multiple of our projects. Problem is of course that in a lot of projects the deps are not exact deps in package.json, meaning that the latest 7.x version of DID-JWT will be used.

The errors we are seeing across different projects:
No "exports" main defined in /opt/node/node-v18.16.0-linux-x64/lib/node_modules/@sphereon/gx-agent-cli/node_modules/did-jwt-vc/node_modules/uint8arrays/package.json

Probably the easiest fix is to downgrade uint8arrays in did-jwt. I created the bug-report here, because IMO a bit more care should have been taken when releasing this library and then including a major new version of a really important dep, without changing the major version of this project.

same issue for me what version i need to downgrade to

Any progress on this issue?

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

commented

We have hit this issue

For everyone else who hits this, you can use yarn resolutions to work around it. It's a hack, but until it is fixed in this project do this in your package.json:

  "resolutions": {
    "did-jwt-vc": "3.1.0"
  }

If you aren't using yarn then good luck - this won't fix it.

Facing the same issue. Anyone proposing a fix? Would like to avoid downgrade.

We can probably downgrade uint8arrays to v3.1.1 in did-jwt to ameliorate these issues but I suspect you will be facing more issues like this going forward as more libs are switching to pure-ESM builds.

If you have some spare cycles, please raise a PR with the downgrade.

Note that there are usable configs for expo, jest, nodejs, and most other environments that should allow you to use ESM libraries.

Any updates on this? I really need to use this lib

@nacho-villanueva maybe I can help u. Following @nick-verida and @mirceanis comments I'm able to use did-jwt lib and avoid that error (you can give it a try also for did-jwt-vc which uses exactly did-jwt inside).

If you use yarn you can write these resolutions in your package.json file:

"resolutions": {
    "uint8arrays": "3.1.1",
    "multiformats": "9.4.2"
}

I know that this is a big downgrade of versions, but if you have development purposes, it could work for now.

@mmatteo23 Yup. In npm I did this and it worked. I needed it for something I'm doing for my thesis, so as long as it works, it's good for me. Thanks!

"overrides": {
    "uint8arrays": "3.1.1"
  },

As stated earlier, the "easy fix" is downgrading the dependencies in did-jwt.
I created an issue and a PR for this there. Please voice your opinion if you prefer or opose a downgrade.

๐ŸŽ‰ This issue has been resolved in version 3.2.14 ๐ŸŽ‰

The release is available on:

Your semantic-release bot ๐Ÿ“ฆ๐Ÿš€