Skip to content

fix: builtin resolution of electron modules via asar hook - #324861

Merged
Robo (deepak1556) merged 1 commit into
mainfrom
robo/fix_asar_builtin_resolution
Jul 8, 2026
Merged

Robo (deepak1556) merged 1 commit into
mainfrom
robo/fix_asar_builtin_resolution

Conversation

@deepak1556 Robo (deepak1556) added this to the 1.129.0 milestone Jul 8, 2026
@deepak1556 Robo (deepak1556) self-assigned this Jul 8, 2026
Copilot AI review requested due to automatic review settings July 8, 2026 04:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes builtin resolution of Electron modules in the ESM asar loader hook (bootstrap-esm.ts). Electron injects a synthetic electron module (also reachable as electron/main, electron/common, electron/renderer) that resolves to the electron: URL scheme rather than a real file, and node:module#isBuiltin does not recognize it. Without special handling, the resolve hook would attempt to redirect these specifiers into the node_modules.asar archive, which is incorrect. The fix detects Electron builtins explicitly and skips archive redirection for them, addressing the five linked vscode-engineering issues.

Changes:

  • Add an isElectronBuiltin helper that matches electron and electron/* specifiers.
  • Extend the archive-resolution guard in the ESM resolve hook to bypass Electron builtins, deferring to the default resolver.

@deepak1556

Copy link
Copy Markdown
Collaborator Author

@deepak1556
Robo (deepak1556) marked this pull request as ready for review July 8, 2026 04:52
@deepak1556
Robo (deepak1556) merged commit 5928613 into main Jul 8, 2026
52 of 54 checks passed
@deepak1556
Robo (deepak1556) deleted the robo/fix_asar_builtin_resolution branch July 8, 2026 05:04
Robo (deepak1556) added a commit that referenced this pull request Jul 8, 2026
* Revert "fix: builtin resolution of electron modules via asar hook (#324861)"

This reverts commit 5928613.

* Revert "fix: restrict asar esm hook resolution to app resources (#324851)"

This reverts commit 89bc382.

* Revert "feat: restore asar for node_modules (#324084)"

This reverts commit c9dda3b.
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators Aug 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants