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

fix: revert to legacyMainResolve in JavaScript for asar compatibility #41367

Merged
merged 1 commit into from Feb 19, 2024

Conversation

VerteDinde
Copy link
Member

Description of Change

Addresses #41241

Node's recent upstream conversion of legacyMainResolve from JavaScript to C++ (nodejs/node#48325) unfortunately doesn't take asar files into account, and may either incorrectly load or entirely fail to find and load the main file if an app is using a combination of ESM and asar, and one of the dependencies is using CommonJS. This PR reverts the native code change while we determine how to patch Node's new methods using asar.

Note: This revert was submitted in place of a potentially riskier fix for Electron's 29 stable release date. I targeted both main and 29-x-y in order to avoid main/branch drift, but happy to target this at 29-x-y only if we'd prefer that.

Checklist

Release Notes

Notes: Fixed an issue where some dependencies using CommonJS would cause ESM apps to fail to open.

@VerteDinde VerteDinde requested a review from a team as a code owner February 18, 2024 07:09
@electron-cation electron-cation bot added the new-pr 🌱 PR opened in the last 24 hours label Feb 18, 2024
@VerteDinde VerteDinde added semver/patch backwards-compatible bug fixes target/29-x-y PR should also be added to the "29-x-y" branch. labels Feb 18, 2024
@codebytere
Copy link
Member

Supersedes #41348 - we're going to try a better long-term performant fix for 30 and fix it via revert for now.

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours label Feb 19, 2024
@VerteDinde VerteDinde merged commit 995f3dc into main Feb 19, 2024
22 checks passed
@VerteDinde VerteDinde deleted the legacy-module-resolve-js-revert branch February 19, 2024 07:21
Copy link

release-clerk bot commented Feb 19, 2024

Release Notes Persisted

Fixed an issue where some dependencies using CommonJS would cause ESM apps to fail to open.

@trop
Copy link
Contributor

trop bot commented Feb 19, 2024

I have automatically backported this PR to "29-x-y", please check out #41371

@trop trop bot added in-flight/29-x-y and removed target/29-x-y PR should also be added to the "29-x-y" branch. labels Feb 19, 2024
@trop trop bot added merged/29-x-y PR was merged to the "29-x-y" branch. and removed in-flight/29-x-y labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged/29-x-y PR was merged to the "29-x-y" branch. semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants