Developers
Bundling & Troubleshooting
General

Troubleshooting

Bundling issues

WASM and web worker not included in output bundle (Webpack)

You might need to use the CopyPlugin by adding this to your Webpack config:

const CopyPlugin = require('copy-webpack-plugin');
 
module.exports = {
    plugins: [
        new CopyPlugin({
            patterns: [
              {
                from: path.resolve(path.dirname(require.resolve('@nymproject/mix-fetch/package.json')), '*.wasm'),
                to: '[name][ext]',
              },
              {
                from: path.resolve(path.dirname(require.resolve('@nymproject/mix-fetch/package.json')), '*worker*.js'),
                to: '[name][ext]',
              },
          ],
        }),
    ],
}

require.resolve('@nymproject/mix-fetch/package.json') finds the disk location of the Nym SDK package. path.dirname resolves the directory, and the *.wasm glob matches the WASM files. Use [name][ext] to preserve the output filename, because the package expects it to stay the same.

ESM not supported

If your bundler does not support ECMAScript Modules (ESM), CommonJS packages are supported for most parts of the SDK.

For those that don't have ESM versions, you will need to use a tool like Babel (opens in a new tab) to convert ESM to CommonJS.

CSP prevents loading

If you are using a *-full-fat package, or if you inline WASM or web workers, you may not be able to load them if the CSP (opens in a new tab) prevents WASM from being instantiated from a string.

You'll have to experiment with either adjusting the CSP or use another variant that is unbundled.

Mixnet client issues

Insufficient topology error

The mixnet client will complain about insufficient topology in the following cases:

  • There are empty mix layers (rare)
  • The gateway you've registered with does not appear in the network topology; it is either unbonded or was blacklisted
  • The gateway you want to send packets to does not appear in the network topology; it is either unbonded or was blacklisted

To avoid the last two, make sure the gateway you are using is bonded and whitelisted.

Checking gateway status

Your client address has the format: client-id.client-dh@gateway-id

For example: DpB3cHAchJi...suko.ANNWrvHq...U2Vx@2BuMSfMW...3SEh

  • First part: client's identity key
  • Second part: client's Diffie-Hellman key
  • After @: gateway's identity key. Search for this in the Nym Explorer (opens in a new tab) to check its status