Skip to content

"Module did not self-register." <-- This is a problem. #1887

@isaacs

Description

@isaacs

Between 0.10 and 0.12, we changed the binary module registration flow in process.dlopen.

This was done for Good Reasons.

I think now in retrospect, it's clear that was a mistake. It dramatically increases the user friction to switch from 0.10 to 0.12. Here's how the flow goes:

  1. "Hm, this io.js thing looks interesting. Lemme try it out"
  2. installs io.js
  3. Error from 5 levels deep in the dep tree: Module did not self-register.
  4. "Well, that was fun, but it's clearly broken. Back to 0.10!"

If we're lucky, they post an issue, and someone here says, "The problem is the module, go write some C++." In other words, "I believe I did, Bob."

What if we detected a null pointer here https://github.com/nodejs/io.js/blob/c1de6d249e9b17d53edc0a713c1e43ef9b457ea7/src/node.cc#L2130-L2133
and then instead of throwing, fall back to the old DLOpen.

I'm sure that literally zero users would complain if their modules start working.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c++Issues and PRs that require attention from people who are familiar with C++.discussIssues opened for discussions and feedbacks.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions