multiversx / mx-sdk-js-core

MultiversX SDK for interacting with the MultiversX blockchain (in general) and Smart Contracts (in particular).
https://multiversx.github.io/mx-sdk-js-core/
Other
60 stars 37 forks source link

Error - sdk-bls-wasm, Module not found: Can't resolve 'fs' #520

Open andreibancioiu opened 2 weeks ago

andreibancioiu commented 2 weeks ago

Error when building a project:

./node_modules/@multiversx/sdk-bls-wasm/bls_c.js:9:1108
Module not found: Can't resolve 'fs'

Reported on Telegram:

andreibancioiu commented 2 weeks ago

If using webpack, adjust the fallbacks configuration as follows:

webpack: (config, { buildId }) => {
    config.resolve.fallback = {
      fs: false, // This will prevent fs from being bundled for the client
      // You can add other shims here if needed
    }
}

Solution proposed on Telegram:

andreibancioiu commented 2 weeks ago

This is related to the recent inclusion of sdk-wallet into sdk-core, as part of the SDKs unification process.

At some point into the (near) future, sdk-bls-wasm will be dropped - to be replaced by noble-curves. See: https://github.com/multiversx/mx-sdk-js-wallet/issues/30 and https://github.com/multiversx/mx-sdk-js-wallet/pull/51.