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
Build success, and browser target should produce file with crypto-browserify instead of crypto
😯 Current Behavior
The crypto-browserify module installed, but build failed with error:
🚨 Build failed.
@parcel/core: Failed to resolve 'crypto' from './src/utils/buffer.utils.ts'
path\src\utils\buffer.utils.ts:1:20
> 1 | import crypto from "crypto";
> | ^^^^^^^^
2 | import ValidationUtils from "./validation.utils";
3 |
@parcel/resolver-default: External dependency "crypto-browserify" is not declared in package.json.
💁 Possible Solution
It seems that it started to happen after v2.9.0: #9843 (comment)
🔦 Context
I want to support both nodejs and browser targets for my library, but i need to polyfill the crypto module.
the Buffer successfully polyfilled with buffer, but crypto is failing.
🐛 bug report
@parcel/resolver-default: External dependency "crypto-browserify" is not declared in package.json.
as you can see in package.json below, the
"crypto-browserify": "^3.12.1"
is there.also reported here but just closed without answer: #9843
🎛 Configuration (.babelrc, package.json, cli command)
🤔 Expected Behavior
Build success, and browser target should produce file with
crypto-browserify
instead ofcrypto
😯 Current Behavior
The
crypto-browserify
module installed, but build failed with error:💁 Possible Solution
It seems that it started to happen after v2.9.0: #9843 (comment)
🔦 Context
I want to support both nodejs and browser targets for my library, but i need to polyfill the crypto module.
the Buffer successfully polyfilled with
buffer
, butcrypto
is failing.💻 Code Sample
https://gitlab.com/nexa/libnexa-ts/-/blob/main/src/crypto/hash.ts?ref_type=heads#L14
🌍 Your Environment
The text was updated successfully, but these errors were encountered: