sefa
June 10, 2024, 9:46am
1
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
sefa
June 10, 2024, 9:47am
2
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
sefa
June 25, 2024, 7:36am
4
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'
}