paulmillr / noble-hashes

Audited & minimal JS implementation of hash functions, MACs and KDFs.
https://paulmillr.com/noble
MIT License
545 stars 46 forks source link

warning: Attempted to import the module #76

Closed steida closed 9 months ago

steida commented 9 months ago

When noble-hashes are used with React Native

warning: Attempted to import the module "/Users/danielsteigerwald/dev/evolu/node_modules/@noble/hashes/crypto.js" which is not listed in the "exports" of "/Users/danielsteigerwald/dev/evolu/node_modules/@noble/hashes". Falling back to file-based resolution. Consider updating the call site or asking the package maintainer(s) to expose this API.

paulmillr commented 9 months ago

can you show the exact import of noble that you are using?

steida commented 9 months ago
import { hmac } from "@noble/hashes/hmac";
import { sha512 } from "@noble/hashes/sha512";
import { randomBytes } from "@noble/hashes/utils";
paulmillr commented 9 months ago

it's just a warning? is everything working?

steida commented 9 months ago

Yeah, it works. Maybe there's something wrong with Metro. I would wait for the official release - https://metrobundler.dev/docs/package-exports

paulmillr commented 9 months ago

i don't think we can do anything here. Crypto is declared in exports.