justadudewhohacks / justadudewhohacks/opencv4nodejs

opencv4nodejs inside worker threads

Open
#555 6 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.