Closed schancel closed 3 years ago
https://github.com/indutny/bn.js/blob/master/lib/bn.js#L51-L55
Buffer will already be defined, and require() simply returns an empty object in Capacitor. This results in Buffer being reset to undefined and triggering asserts later on. Not sure what the best course of action is here due to variable lifetimes.
undefined
Maybe:
const tryPolyfillBuffer = () => { if(typeof Buffer !== 'function') { try { return require('buffer').Buffer; } catch (err) { return Buffer; } } return Buffer; } let Buffer = tryPolyfillBuffer();
Closed in https://github.com/indutny/bn.js/pull/260
https://github.com/indutny/bn.js/blob/master/lib/bn.js#L51-L55
Buffer will already be defined, and require() simply returns an empty object in Capacitor. This results in Buffer being reset to
undefined
and triggering asserts later on. Not sure what the best course of action is here due to variable lifetimes.Maybe: