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 #165

Closed
ericman314 opened this issue Jul 11, 2020 · 5 comments
Closed

Module did not self-register #165

ericman314 opened this issue Jul 11, 2020 · 5 comments

Comments

@ericman314
Copy link

I'm running into a bug while using svg2img inside of a worker to convert svgs to png images. 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/arcify/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)

I have no idea if this is a bug with workerpool, svg2img, or one of its dependencies. The puzzling thing is that it works when a single child thread runs, but not when multiple child threads are running. I will try to produce a minimal working example and post the code here.

@josdejong
Copy link
Owner

Hi Eric, this doesn't ring a bell for me. That it only happens when working with multiple workers sounds odd, since these are isolated processes. Would be great if you can create a minimal example demonstrating the issue so we can do some digging.

@ericman314
Copy link
Author

Thanks. I created a project to illustrate the bug. Edit index.js to select either series or parallel. I'll raise the issue over at svg2img and see if anyone there knows anything about it.

https://github.com/ericman314/svg2img-workerpool

@josdejong
Copy link
Owner

👍 I'll see if I have some time to look into it tomorrow.

@ericman314
Copy link
Author

ericman314 commented Jul 11, 2020

Thank you, but there's no need--looks like the issue is with node-canvas not supporting workers: Automattic/node-canvas#1394

@josdejong
Copy link
Owner

Ah, ok 👍

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

2 participants