Menci / Menci/vite-plugin-wasm

Import wasm in worker, delays defining message callback in FireFox

Open
#67 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
431
Forks
27
PR merge metrics
No merged PRs in 30d

Description

In Firefox
In App.vue, I am creating the worker then later on in App.ts sending a postmessage.
The worker loads after I post the message so there is no message handler setup yet.

I am also using vite-plugin-top-level-wait

https://github.com/greenpdx/vue_wasm_template
branch oworker

I know what is happening but I don't know how to fix it.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Firefox case from the linked vue_wasm_template repository on branch oworker, starting with worker creation in App.vue and the postMessage call in App.ts. Compare the worker-loading and callback-registration timing with and without vite-plugin-top-level-wait; done means the worker reliably handles the message sent during startup.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, wasm
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.