fabric
fabric copied to clipboard
Debug polyfill buffer error
Error stems from fabric.http.js minified file.
WASM_BUFFER
is used in secp256k1 which is a wasm compiled dependency.
Line producing the error const WASM_BUFFER = new Uint8Array(wasm.memory.buffer);
https://github.com/web3/web3.js#troubleshooting-and-known-issues
https://stackoverflow.com/questions/64557638/how-to-polyfill-node-core-modules-in-webpack-5
Integrating wasm to webpack did not make any progress, showed same errors
- https://www.npmjs.com/package/@rollup/plugin-wasm
- recommended to have relative paths, using ./ instead of _dirname
- add alias to file https://stackoverflow.com/a/71956791
- updating rollup config to use buffer https://github.com/SheetJS/sheetjs/issues/2367
- installing buffer https://github.com/feross/safe-buffer/issues/30
ordering of dependencies could cause issues, list parent dependencies below child dependencies
https://viglucci.io/how-to-polyfill-buffer-with-webpack-5