Wallet example wasm problem

Hi, I’ve implemented this example: concordium-node-sdk-js/examples/wallet at main · Concordium/concordium-node-sdk-js · GitHub on nextjs without web workers and it works well on chrome, but it’s not working on android browser

When I implemented it as in the example with web workers I’m getting document is not defined error
this error comes from identity-worker.ts file’s const identityRequest = createIdentityRequestWithKeys(e.data); line

with web workers comes from createIdentityRequestWithKeys method

Sorry for not getting back to you earlier.

With regards to your first post, my best guess is that you did not include the alias included in the vite.config.ts file in the original example.

You should be able to do something similar for the webpack config in nextJS.

Hope this helps

1 Like

Hi @soerenbz looks like it has been fixed with this changes
next.config.js

// WASM and top-level await configuration
    config.experiments = {
      asyncWebAssembly: true,
      topLevelAwait: true
    }

    config.resolve.alias = {
      ...config.resolve.alias,
      '@concordium/rust-bindings': '@concordium/rust-bindings/bundler'
    }

Great to hear!

Happy hacking!

1 Like