Failed to resolve uint8arrays

I can’t seem to get past this when upgrading things, installing new versions. Have tried deleting cache/node_modules and reinstalling everything. Also tried installing uint8arrays directly to no avail. Any ideas?
image

deleting the uint8arrays import in that file allows it to build - but not ideal solution…

Is from trying to use did-session? and what version of cacao/did-session? (does look like latest)

Also your node version?

correct - believe it was installed from did-session, node v16.16.0

thanks, which ceramic related library are you interacting with directly? (selfid?) and using with an eth account?

Not interacting with any at this point as I can’t get it to build because of that error :slight_smile: I was in the progress of upgrading from the old IDX toolset and 1.5(ish) versions of the packages I had installed. Trying to use the following:
@ceramicnetwork/http-client - 2.13.0
@ceramicnetwork/stream-tile - 2.12.0
@glazed/devtools 0.2.0
@glazed/did-datastore 0.3.2
dids 3.4.0
key-did-provider-ed25519 2.0.1
key-did-resolver 2.3.0

Not using Eth accounts - working with the dids directly.

ok, so not using did-session or selfid, this is just failing on install? I cant really tell at which point you are ending up the dependency that is causing the error here

So all those modules install fine with no issues. Do the yarn add for each and all good. Immediately after, I try to run the build command for the app and that error shows up. If I go in and delete that unit8array line in the module code, then rerun the build command it works fine/finishes.

Hopefully that makes it more clear.

oh ok, hmm difficult to say, on thing i noticed is the version differs for uint8array in that package, maybe the package manager is not installing both versions

maybe trying forcing it to resolve the same version (dont think downgrading would cause any other issues), for yarn you could add it to resolutions in your package.json

If it does work, it may not be the best solution, but difficult to replicate without anyone else reporting, and we should probably update version in other libs.

"resolutions": {
  "@didtools/cacao/uint8arrays": "^3.0.0”
}

Unfortunately, didn’t work, but using following did - hopefully won’t cause any side effects:

"resolutions": {
    "uint8arrays": "^3.0.0"
}

My yarn.lock is showing four different versions of uint8array:

  • most of the ceramic packages - ^3.0.0
  • @didtools/cacao@^1.0.0 - ^4.0.2
  • @didtools/pkh-solana@^0.0.1 - ^3.1.0
  • nist-weirstrauss ^1.3.0 (dependency of key-did-resolver ) - ^2.1.4
1 Like

Ok, yeah in your setup you wont be relying on the @didtools/cacao library, should be no issue and would be obvious otherwise i think. Would be nice to find root cause, but will likely wait to see if anyone else reports before revisiting.

2 Likes

I’m facing the exactly same problem. The sample app from the EthDenver workshop builds just fine (GitHub - ceramicstudio/ethdenver-workshop: Application used for the workshop at EthDenver 2023). However when I try to add those features to an existing project I get the same kind of error as reported by @Aaron. I tried the β€œresolutions” suggestion but no luck.

Copying the resolution from discord for posterity:

This is what I had to do:

 "overrides": {
        "uint8arrays": "^2.1.10",
        "multiformats": "^9.0.0",
        "@ipld/dag-cbor": "^7.0.3"
    }

@spencer @zfer - build is now throwing these errors after upgrading to latest key-did-resolver (3.0.0) -


@parcel/core: Failed to resolve 'multiformats/bases/base58' from './node_modules/key-did-resolver/dist/index.js'

  /home/vitalpointai/projects/guilds/node_modules/key-did-resolver/dist/index.js:184:27
    183 |  */ /* eslint-disable  @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call, @type
  > 184 | import { base58btc } from 'multiformats/bases/base58';
  >     |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    185 | import * as secp256k1 from './secp256k1.js';
    186 | import * as ed25519 from './ed25519.js';

Tried similar fixes to the uint8array issue above, but haven’t found a solution yet.

I’ll look in it, can you check if you have multiple versions of the β€˜multiformats’ package installed?

also the original uint8arrays issue is likely resolved, i believe we updated that dependency to the same version in all ceramic related dependencies now

Looks to be a couple versions (9.9.0 and 11.0.2)

β”œβ”€β”¬ @ceramicnetwork/http-client@2.21.0
β”‚ β”œβ”€β”¬ @ceramicnetwork/common@2.24.0
β”‚ β”‚ └── multiformats@11.0.2  deduped
β”‚ β”œβ”€β”¬ @ceramicnetwork/stream-model@1.6.0
β”‚ β”‚ β”œβ”€β”¬ @ipld/dag-cbor@7.0.3
β”‚ β”‚ β”‚ └── multiformats@9.9.0 
β”‚ β”‚ β”œβ”€β”€ multiformats@11.0.2  deduped
β”‚ β”‚ └─┬ multihashes@4.0.3
β”‚ β”‚   └─┬ uint8arrays@3.1.1
β”‚ β”‚     └── multiformats@9.9.0 
β”‚ └─┬ @ceramicnetwork/streamid@2.14.0
β”‚   └── multiformats@11.0.2  deduped
β”œβ”€β”¬ @glazed/devtools@0.2.0
β”‚ β”œβ”€β”€ multiformats@9.9.0 
β”‚ └─┬ uint8arrays@3.1.1
β”‚   └── multiformats@9.9.0  deduped
β”œβ”€β”¬ dids@4.0.0
β”‚ β”œβ”€β”¬ @didtools/cacao@2.0.0
β”‚ β”‚ β”œβ”€β”¬ @ipld/dag-cbor@9.0.0
β”‚ β”‚ β”‚ └── multiformats@11.0.2  deduped
β”‚ β”‚ └── multiformats@11.0.2  deduped
β”‚ β”œβ”€β”¬ dag-jose-utils@3.0.0
β”‚ β”‚ └── multiformats@11.0.2  deduped
β”‚ β”œβ”€β”¬ did-jwt@6.11.6
β”‚ β”‚ β”œβ”€β”€ multiformats@9.9.0 
β”‚ β”‚ └─┬ uint8arrays@3.1.1
β”‚ β”‚   └── multiformats@9.9.0  deduped
β”‚ β”œβ”€β”€ multiformats@11.0.2 
β”‚ └─┬ uint8arrays@4.0.3
β”‚   └── multiformats@11.0.2  deduped
└─┬ key-did-resolver@3.0.0
  β”œβ”€β”€ multiformats@11.0.2  deduped
  └─┬ nist-weierstrauss@1.6.1
    β”œβ”€β”€ multiformats@9.9.0 
    └─┬ uint8arrays@2.1.10
      └── multiformats@9.9.0  deduped

I have deleted node_modules/parcel-cache and reinstalled everything a couple times to make sure I was starting from a clean slate.

Ref the uint8array issue - if I remove the resolutions in the package.json, the error comes back.

@zfer - any ideas?

Hey all, I’m having a similar issue with uint8arrays. I’m also using parcel to build my project, and am getting this error when trying to run my dev script. I was using older package versions before and everything had built fine, and my impetus for updating was to see if it would help resolve a CORS error I encountered while testing - but now that I’ve updated them, this has cropped up.

Here are all the dependency versions I’d like to work with:
β€œ@ceramicnetwork/http-client”: β€œ^2.21.0”,
β€œ@ceramicnetwork/stream-tile”: β€œ^2.20.0”,
β€œbip39”: β€œ^3.1.0”,
β€œdids”: β€œ^4.0.0”,
β€œkey-did-provider-ed25519”: β€œ^3.0.0”,
β€œkey-did-resolver”: β€œ^3.0.0”,
β€œparcel”: β€œ^2.8.3”,
β€œsss-wasm”: β€œ^0.4.0”

I’ve also tried clearing out my parcel-cache and npm_modules and reinstalled them to clean out things, but I’m still having issues.

@cnr Was about to ask you for parcel config, but found how to reproduce it. Looking for the fix. It must be something with how Parcel handles conditional exports.

@cnr See Use `package.json#exports` map Β· Issue #4155 Β· parcel-bundler/parcel Β· GitHub If you use nightly version of parcel, it works. uint8arrays uses conditional exports, and GA parcel does not handle them well.

2 Likes