You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently when importing noble-ciphers and noble-hashes on React Native, the following warnings are shown:
WARN Attempted to import the module "/Users/user/ReactNativeDemo/node_modules/.pnpm/@[email protected]/node_modules/@noble/ciphers/crypto.js" which is not listed in the "exports" of "/Users/user/ReactNativeDemo/node_modules/.pnpm/@[email protected]/node_modules/@noble/ciphers" under the requested subpath "./crypto.js". Falling back to file-based resolution. Consider updating the call site or asking the package maintainer(s) to expose this API.
WARN Attempted to import the module "/Users/user/ReactNativeDemo/node_modules/.pnpm/@[email protected]/node_modules/@noble/hashes/crypto.js" which is not listed in the "exports" of "/Users/user/ReactNativeDemo/node_modules/.pnpm/@[email protected]/node_modules/@noble/hashes" under the requested subpath "./crypto.js". Falling back to file-based resolution. Consider updating the call site or asking the package maintainer(s) to expose this API.
It looks like for metro bundler, import { crypto } from '@noble/ciphers/crypto'; is equivalent to import { crypto } from '@noble/ciphers/crypto.js';. Because "./crypto.js" is not defined in package.json, it falls back to the file-based resolution.
Possible fix
Add "./crypto.js" in package.json can fix the warnings above
Description
Currently when importing noble-ciphers and noble-hashes on React Native, the following warnings are shown:
It looks like for metro bundler,
import { crypto } from '@noble/ciphers/crypto';
is equivalent toimport { crypto } from '@noble/ciphers/crypto.js';
. Because"./crypto.js"
is not defined in package.json, it falls back to the file-based resolution.Possible fix
Add
"./crypto.js"
in package.json can fix the warnings aboveReference: https://metrobundler.dev/docs/package-exports/
The text was updated successfully, but these errors were encountered: