Error when initializing Child Workers
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, webpack
Research direction
Start in rpc-wrapper.js at the ready-event code around line 20 and trace how child workers are initialized from a parent worker. Check why document is accessed in that path and how the ready event is expected to behave. Done means child workers initialize without the document error while preserving the ready event and its IE compatibility.
Written by the indexing model from the issue text.
Description
I tried initializing child web workers from a parent worker, and it seems to work well with the exception of the following error being thrown:
rpc-wrapper.js:20 Uncaught ReferenceError: document is not defined
at Worker.<anonymous> (rpc-wrapper.js:20)
Digging in, it seems like its part of building up the ready event, although document is not in scope in the context of a WebWorker.
let evt = document.createEvent('Event');
evt.initEvent(d.method, false, false);
evt.data = d.params;
worker.dispatchEvent(evt);
What is the purpose of the ready event? Is there a way to build the event in a WebWorker-safe manner? I've looked into new Event, but that's not IE compatible.
- Dominant language
- JavaScript
- Stars
- 2.3k
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
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.
More from developit/workerize-loader
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
developit/workerize-loader#131 · 6 comments · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
developit/workerize-loader#130 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
developit/workerize-loader#129 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
developit/workerize-loader#128 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
developit/workerize-loader#126 · 4 comments ·
All issues in developit/workerize-loader
Similar issues
-
Bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Automattic/safe-publish#594 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
dream-num/dsh-univer-office#104 ·
-
comp/dashboard invalid P3
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
NousResearch/hermes-agent#121143 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
avniproject/avni-webapp#1811 ·
-
area/auroraboot area/webui bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100