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" on Heroku #1789

Open
dumaron opened this issue Aug 25, 2023 · 2 comments
Open

"Module did not self-register" on Heroku #1789

dumaron opened this issue Aug 25, 2023 · 2 comments

Comments

@dumaron
Copy link

dumaron commented Aug 25, 2023

After installing pino on a private project deploys on Heroku fails. The error message that I've got is:

Error: Module did not self-register: '/app/.heroku/heroku-nodejs-plugin/heroku-nodejs-plugin.node'.
    at Module._extensions..node (node:internal/modules/cjs/loader:1338:18)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Array.__webpack_modules__ (/app/.heroku/heroku-nodejs-plugin/index.js:1079:19)
    at __webpack_require__ (/app/.heroku/heroku-nodejs-plugin/index.js:1106:41)
    at Array.<anonymous> (/app/.heroku/heroku-nodejs-plugin/index.js:19:21)
    at __webpack_require__ (/app/.heroku/heroku-nodejs-plugin/index.js:1106:41)
    at /app/.heroku/heroku-nodejs-plugin/index.js:1127:17
Emitted 'error' event on Worker instance at:
    at [kOnErrorMessage] (node:internal/worker:290:10)
    at [kOnMessage] (node:internal/worker:301:37)
    at MessagePort.<anonymous> (node:internal/worker:202:57)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:735:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28) {
  code: 'ERR_DLOPEN_FAILED'

It seems that this issue is somewhat common in NodeJS land (1 2) but there are no solution so far that doesn't involve changing external libraries. I tried to identify what part/library of pino was causing this issue, but with no luck so far.

While I will definitely discuss this issue with Heroku support, does anyone know if there's a way to runpino in the main thread, which should be de thing the issue comes from? Maybe there are transports that do that?

@mcollina
Copy link
Member

most transports have some kind of API to instatiate them as streams.

@dumaron
Copy link
Author

dumaron commented Aug 28, 2023

So far I've tried both pino-pretty and pino-datadog-transport but both seem to be streams, and the issue is still there. I'll continue investigating 👍

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