justadudewhohacks / justadudewhohacks/opencv4nodejs
opencv4nodejs inside worker threads
Open
- Dominant language
- C++
- Stars
- 5.1k
- Forks
- 826
- PR merge metrics
- No merged PRs in 30d
Description
Using `opencv4nodejs` inside a worker thread causes the error message `Module did not self-register`.
To make it work the module must be context aware as described [here](https://nodejs.org/docs/latest-v10.x/api/addons.html#addons_context_aware_addons).
To reproduce the little snippet below (which is based on [this](https://github.com/nodejs/node/issues/21481) bug report) can be used:
```bash
$ cat > a.js << EOF
const cv = require('opencv4nodejs');
const {Worker} = require('worker_threads');
new Worker(__filename);
EOF
$ node --experimental-worker a.js
```
Contributor guide
Assessment
This issue has not been assessed yet.