ol-th / pdf-img-convert.js

Simple node package to convert a PDF into images.
MIT License
161 stars 38 forks source link

invalid ELF header #7

Open hobgoblina opened 3 years ago

hobgoblina commented 3 years ago

I'm running into this issue after installing the module. It's crashing my docker container. Not sure if this error output is useful to you... also not sure what exactly is the issue here as I'm not too familiar with developing node modules. :P

payoff_1      | internal/modules/cjs/loader.js:1194
payoff_1      |   return process.dlopen(module, path.toNamespacedPath(filename));
payoff_1      |                  ^
payoff_1      | 
payoff_1      | Error: /app/node_modules/canvas/build/Release/canvas.node: invalid ELF header
payoff_1      |     at Object.Module._extensions..node (internal/modules/cjs/loader.js:1194:18)
payoff_1      |     at Module.load (internal/modules/cjs/loader.js:993:32)
payoff_1      |     at Function.Module._load (internal/modules/cjs/loader.js:892:14)
payoff_1      |     at Module.require (internal/modules/cjs/loader.js:1033:19)
payoff_1      |     at require (internal/modules/cjs/helpers.js:72:18)
payoff_1      |     at Object.<anonymous> (/app/node_modules/canvas/lib/bindings.js:3:18)
payoff_1      |     at Module._compile (internal/modules/cjs/loader.js:1144:30)
payoff_1      |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
payoff_1      |     at Module.load (internal/modules/cjs/loader.js:993:32)
payoff_1      |     at Function.Module._load (internal/modules/cjs/loader.js:892:14)
payoff_1      |     at Module.require (internal/modules/cjs/loader.js:1033:19)
payoff_1      |     at require (internal/modules/cjs/helpers.js:72:18)
payoff_1      |     at Object.<anonymous> (/app/node_modules/canvas/lib/canvas.js:9:18)
payoff_1      |     at Module._compile (internal/modules/cjs/loader.js:1144:30)
payoff_1      |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
payoff_1      |     at Module.load (internal/modules/cjs/loader.js:993:32)
payoff_1      |     at Function.Module._load (internal/modules/cjs/loader.js:892:14)
payoff_1      |     at Module.require (internal/modules/cjs/loader.js:1033:19)
payoff_1      |     at require (internal/modules/cjs/helpers.js:72:18)
payoff_1      |     at Object.<anonymous> (/app/node_modules/canvas/index.js:1:16)
payoff_1      |     at Module._compile (internal/modules/cjs/loader.js:1144:30)
payoff_1      |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:1164:10)
payoff_1      | [nodemon] app crashed - waiting for file changes before starting...
ol-th commented 3 years ago

From the output it seems like it's a problem with the node_canvas build. This kind of error is usually caused by trying getting modules built on 1 OS and trying to run it on another. Have you added your node_modules folder to your .dockerignore?

hobgoblina commented 3 years ago

Yep, I've seen that solution but I already had the folder in my .dockerignore

hobgoblina commented 3 years ago

Also looked at some related issues on the canvas github, but didn't see any different solutions that worked for me. I'll go ahead and ask there as well but figured I'd leave this one open in case there might be anything worth patching on your end.

ol-th commented 3 years ago

I'll try to set this up in a docker container and report back if anything works 👍

hobgoblina commented 3 years ago

Heyo, just wondering if you've been able to get around to testing this. Thanks!!