Devtools interference with worker
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 279
- PR merge metrics
- No merged PRs in 30d
Description
In my Vite-Vue project, I use web-workers.
Recently, we migrated to Vue 3. Sometimes I recieve unexpected input in my worker. I believe it was vue devtools interferring.
For now, a quick fix is to ignore those worker messages, but I do not think this is expected behahiour.
The reason I believe this is a devtools issue, is because the worker starts recieving these messages after I open the vue-devtools menu in chrome devtools. When I open the "vue" tab in the chrome devtools, I get multiple events to the worker. After that, it will send messages on a interval (Something like 30 seconds -> "shutdown" -> 1 seconds -> "init" -> ....repeat).
The web-worker messageEvent data always contains a key "source" with value "proxy->server" and a key "payload" that changes. The payload is json. Sometimes it is something like "init", "shutdown". Or something like below:
{"json":{"m":"getInspectorTree","a":[{"inspectorId":"components","filter":""}],"i":"9vkVZVzy2gequPNhAsTBF","t":"q"}}
Versions:
Vue: 3.5.11
Devtools chrome extension: 7.6.8
I import my worker like below:
import ValidationWorker from "./validationWorker.ts?worker";
if(config.worker === true){
this.worker = new ValidationWorker();
}
Again, I do not now for sure this is a vue devtools issue, but beceause the issue appears right after, and never before I open the "vue" tab in my chrome devtools. It is very likely to be related to vue devtools.
I do not have a reproduction case, I would have to ask my manager if it is okay to put time into creating a minimalistic repoduction case. I hope I have provided enough information. When you have questions, or this behaviour is as expected, feel free to contact me!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the report with the TypeScript worker imported as ./validationWorker.ts?worker, then open the Vue tab in Chrome DevTools and inspect worker messageEvent data for source=proxy->server. Done means devtools activity no longer sends unexpected messages to the worker while normal worker messages continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100