Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: describe some troubleshooting steps for dependency issues #147

Merged
merged 4 commits into from
Aug 1, 2024

Conversation

mirceanis
Copy link
Contributor

@mirceanis mirceanis commented Aug 1, 2024

Add a troubleshooting guide and link to it from different tutorials.

Kudos to @theblockstalk for surfacing these issues and their fixes.

@theblockstalk
Copy link
Contributor

for yarn berry (v2+) this solution is needed:
digitalcredentials/jsonld-signatures#8

"resolutions": {
    "jsonld": "npm:@digitalcredentials/jsonld@^6.0.0"
  },

for all versions of yarn, if you want it to bundle and compile in expo (React Native) then this is needed in package.json
digitalcredentials/jsonld-signatures#9

"resolutions": {
        "isomorphic-webcrypto": "link:./node_modules/@sphereon/isomorphic-webcrypto"
    },

lastly, not sure if such changes are also needed when using npm. I would assume they cant hurn. This uses the "overrides" field in package.json
https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides

@nklomp
Copy link

nklomp commented Aug 1, 2024

Yeah it is a pretty bad situation for RN. The real culprit is in the bad crypto support in RN. We are these days moving to hardware supported crypto only with a new Veramo compatible KMS that can do yubikeys, secure elements, remote HSM, eSIMs etc, so all we need is a RNG / hash functionality. So we have moved to react-native-quick-crypto. That one is nice anyway also for other crypto functions.

The issue is that some of the digital credentials lib require isomorphic-webcrypto, which IMO is a terrable lib and heavily outdated. We only forked it to get it a bit up to date. IMO they should not be using the lib to set the crypto global. Or at least they should check whether it is not already present, and only then set it.

@mirceanis mirceanis marked this pull request as ready for review August 1, 2024 15:26
@mirceanis mirceanis merged commit cbc3b7d into main Aug 1, 2024
5 checks passed
@mirceanis mirceanis deleted the docs-dependency-issues branch August 1, 2024 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants