decentralized-identity / veramo

A JavaScript Framework for Verifiable Data
https://veramo.io
Apache License 2.0
431 stars 131 forks source link

Unable to resolve "uint8arrays" (expo) #1250

Closed simonas-notcat closed 8 months ago

simonas-notcat commented 1 year ago

Bug severity 5

Describe the bug Unable to use Veramo with expo (react native)

Observed behaviour Unable to resolve "uint8arrays" from "node_modules/@veramo/key-manager/build/abstract-key-management-system.js"

Details IMG_0AC3C01860B9-1

Additional context https://github.com/achingbrain/uint8arrays/issues/53

Versions (please complete the following information):

sgno28 commented 10 months ago

Have you found a workaround for this uint8array error? Currently facing it myself when trying to do key management on expo app

mirceanis commented 10 months ago

The problem arises from the metro bundler who doesn't natively deal with modules that lack a main entry in package.json. It tries to look for an index.*js file instead of following javascript trends, so it doesn't look at exports. uint8arrays uses exports exclusively and has no main, and it also lacks an index.js file or equivalents. Apparently there is a flag that can be enabled for the bundler to look at exports: https://metrobundler.dev/docs/package-exports

stale[bot] commented 8 months ago

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.