Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Module did not self-register" using workerpool #33

Closed
ericman314 opened this issue Jul 11, 2020 · 1 comment
Closed

"Module did not self-register" using workerpool #33

ericman314 opened this issue Jul 11, 2020 · 1 comment

Comments

@ericman314
Copy link

I'm running into a bug while using svg2img inside of worker threads using workerpool. If I convert one image at a time using workerpool, everything works fine. But if I try to convert two or more in parallel, I am getting this error:

Error: Module did not self-register.
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1003:18)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)
    at Module.require (internal/modules/cjs/loader.js:849:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/eric/Documents/svg2img-workerpool/node_modules/canvas/lib/bindings.js:3:18)
    at Module._compile (internal/modules/cjs/loader.js:956:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:973:10)
    at Module.load (internal/modules/cjs/loader.js:812:32)
    at Function.Module._load (internal/modules/cjs/loader.js:724:14)

Here's an example demonstrating the issue: https://github.com/ericman314/svg2img-workerpool

I have no idea if this is a bug with workerpool, svg2img, or one of their dependencies. The puzzling thing is that it works when a single child thread runs, but not when multiple child threads are running.

@ericman314
Copy link
Author

Ah nevermind, looks like workers are not supported by node-canvas: Automattic/node-canvas#1394

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant