Skip to content

ESM: restore support for ASAR #228064

Description

For ESM we have disabled ASAR but we should investigate bringing it back.

We used to have this code to inject the lookup path:

module.exports.enableASARSupport = function () {
// ESM-comment-begin
// const NODE_MODULES_PATH = path.join(__dirname, '../node_modules');
// const NODE_MODULES_ASAR_PATH = `${NODE_MODULES_PATH}.asar`;
//
// // @ts-ignore
// const originalResolveLookupPaths = Module._resolveLookupPaths;
//
// // @ts-ignore
// Module._resolveLookupPaths = function (request, parent) {
// const paths = originalResolveLookupPaths(request, parent);
// if (Array.isArray(paths)) {
// for (let i = 0, len = paths.length; i < len; i++) {
// if (paths[i] === NODE_MODULES_PATH) {
// paths.splice(i, 0, NODE_MODULES_ASAR_PATH);
// break;
// }
// }
// }
//
// return paths;
// };
// ESM-comment-end
};

But going forward, Electron should expose a way for us to enlist a path as ASAR path so that it can internally handle this as early as possible.

Activity

  1. added
    debt
    electron
    ESM
    upstream
    on Sep 10, 2024
  2. added
    confirmed
    on Sep 10, 2024
  3. tmm1 commented on Apr 8, 2025

    @tmm1
    Contributor

    Was there any movement on the Electron side here?

  4. deepak1556 commented on Apr 9, 2025

    @deepak1556
    Collaborator

    No we haven't pursued this yet in Electron.

  5. added
    plan-item
    on Oct 7, 2025
  6. 4 remaining items

  7. added
    insiders-released
    on Oct 23, 2025
  8. removed
    insiders-released
    on Nov 11, 2025
  9. added
    unreleased
    insiders-released
    and removed
    unreleased
    on Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ESMdebtelectroninsiders-releasedplan-itemupstream

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions