Skip to content

fix: crash when using vm after window.open() - #37506

Closed
codebytere wants to merge 1 commit into
mainfrom
fix-window-open-crash
Closed

codebytere wants to merge 1 commit into
mainfrom
fix-window-open-crash

Conversation

@codebytere

@codebytere codebytere commented Mar 6, 2023 •

Copy link
Copy Markdown
Member

Description of Change

Closes #37404.
Refs #32057.

Fixes a potential crash when using the vm module in the renderer process after calling window.open(''). This started happening after nodejs/node#44252, which we rolled into Electron via 75d2caf. It appears that eagerly loading the Node.js environment when opening a child window with a blank url also requires a delay, otherwise Node.js isn't able to properly set up the v8::Context for use with vm.

Checklist

Release Notes

Notes: Fixed a potential crash when using the vm module in the renderer process after calling window.open('').

@codebytere
codebytere requested a review from zcbenz March 6, 2023 13:29
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Mar 6, 2023
@codebytere codebytere added semver/patch backwards-compatible bug fixes target/22-x-y PR should also be added to the "22-x-y" branch. target/23-x-y PR should also be added to the "23-x-y" branch. target/24-x-y PR should also be added to the "24-x-y" branch. labels Mar 6, 2023
@codebytere codebytere changed the title fix: crash when using vm after window.open() fix: crash when using vm after window.open() Mar 6, 2023
@codebytere
codebytere force-pushed the fix-window-open-crash branch from 8d1c375 to 0ff6c2a Compare March 6, 2023 13:31
@codebytere codebytere removed the target/22-x-y PR should also be added to the "22-x-y" branch. label Mar 6, 2023
@codebytere
codebytere marked this pull request as ready for review March 6, 2023 13:49
@codebytere
codebytere marked this pull request as draft March 6, 2023 15:18
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Mar 7, 2023
@jkleinsc jkleinsc added the target/25-x-y PR should also be added to the "25-x-y" branch. label Apr 6, 2023
@codebytere codebytere closed this Apr 19, 2023
@codebytere
codebytere deleted the fix-window-open-crash branch April 19, 2023 09:50
@gpetrov

gpetrov commented Apr 19, 2023

Copy link
Copy Markdown

@codebytere what happened here? Were the changes no good? Is there an alternative solution?
This is still a major road block for us.

@gpetrov

gpetrov commented May 11, 2023

Copy link
Copy Markdown

@codebytere does this fix got merged? As I don't see it anywhere and the problem still persist in Electron 23,24 and 25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver/patch backwards-compatible bug fixes target/23-x-y PR should also be added to the "23-x-y" branch. target/24-x-y PR should also be added to the "24-x-y" branch. target/25-x-y PR should also be added to the "25-x-y" branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: proxyquire can't load modules after window.open method is called

3 participants