Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wallet-core.wasm doesn't load in Worker #3811

Open
ArturLevchuk opened this issue Apr 21, 2024 · 3 comments
Open

wallet-core.wasm doesn't load in Worker #3811

ArturLevchuk opened this issue Apr 21, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@ArturLevchuk
Copy link

Describe the bug
I'm trying to use Workers with wallet-core lib and get this type of error:
Failed to execute 'fetch' on 'WorkerGlobalScope': Failed to parse URL from /node_modules/@trustwallet/wallet-core/dist/lib/wallet-core.wasm

To Reproduce
Steps to reproduce the behavior:

module.exports = function (self) {
self.onmessage = async function (event) {
    const { HDWallet} = await initWasm();
    const wallet = HDWallet.create(128, passphrase || "");
  
    const result = JSON.stringify({
      mnemonic:  wallet.mnemonic(),
      passphrase: passphrase,
    });
    self.postMessage(result);
  };
};

Screenshots
image

Additional context
I'm using these plugins:
image

@ArturLevchuk ArturLevchuk added the bug Something isn't working label Apr 21, 2024
@satoshiotomakan
Copy link
Collaborator

Hi @ArturLevchuk, could you please clarify if it can't load wallet-core.wasm in a Worker only? Does it work in a main thread (just like without workers)?

@ArturLevchuk
Copy link
Author

Hi @ArturLevchuk, could you please clarify if it can't load wallet-core.wasm in a Worker only? Does it work in a main thread (just like without workers)?

In the main thread it works good. But in Worker it doesn't

@satoshiotomakan
Copy link
Collaborator

Hi @ArturLevchuk, sorry for the delay, I couldn't find a solution quickly, so postpone it
I'll give an update the next week

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants