forge
forge copied to clipboard
Cannot read property 'crypto' of undefined
app.js错误: TypeError: Cannot read property 'crypto' of undefined at Object.t (vendor.js?t=wechat&s=1680776449375&v=64a94e62456c2f5e6e877651680b0c61:8952) at e (vendor.js?t=wechat&s=1680776449375&v=64a94e62456c2f5e6e877651680b0c61:8952) at Object.t (vendor.js?t=wechat&s=1680776449375&v=64a94e62456c2f5e6e877651680b0c61:8952) at e (vendor.js?t=wechat&s=1680776449375&v=64a94e62456c2f5e6e877651680b0c61:8952) at Object.t (vendor.js?t=wechat&s=1680776449375&v=64a94e62456c2f5e6e877651680b0c61:8952) at e (vendor.js?t=wechat&s=1680776449375&v=64a94e62456c2f5e6e877651680b0c61:8952) at Object.t (vendor.js?t=wechat&s=1680776449375&v=64a94e62456c2f5e6e877651680b0c61:8952) at e (vendor.js?t=wechat&s=1680776449375&v=64a94e62456c2f5e6e877651680b0c61:8952) at Object.t (vendor.js?t=wechat&s=1680776449375&v=64a94e62456c2f5e6e877651680b0c61:8952) at e (vendor.js?t=wechat&s=1680776449375&v=64a94e62456c2f5e6e877651680b0c61:8952)(env: macOS,mp,1.06.2301171; lib: 2.30.3)
More information is needed to help with this.
- What version of forge?
- What environment?
- What is the calling code?
There's some code that uses globalScope.crypto
, which should work in modern runtimes. Looks like there might be some older compatibility hacks from when globalScope
was too new to use in util.globalScope
. I'm unsure what the state of that might be these days. You might try code related to those spots to see what the issue is.
This is probably react-native. You need to provide the crypto primitives in react-native via shims / babel.