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

[Bug]: require gives error after blank window.open #38731

Closed
3 tasks done
gpetrov opened this issue Jun 11, 2023 · 1 comment
Closed
3 tasks done

[Bug]: require gives error after blank window.open #38731

gpetrov opened this issue Jun 11, 2023 · 1 comment
Labels

Comments

@gpetrov
Copy link

gpetrov commented Jun 11, 2023

Preflight Checklist

Electron Version

23.0.0, 24.0.0, 25.0.0

What operating system are you using?

Windows

Operating System Version

Windows, MacOS

What arch are you using?

x64

Last Known Working Electron version

22.0.0

Expected Behavior

When calling window.open('about:blank') any subsequential require should go fine.

Actual Behavior

Starting from Electron 23, after window.open('about:blank') any subsequential require gives the following error:

node:vm:129 Uncaught TypeError: Script methods can only be called on script instances.
    at Script.runInThisContext (node:vm:129:12)
    at wrapSafe (node:internal/modules/cjs/loader:1177:19)
    at Module._compile (node:internal/modules/cjs/loader:1225:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1324:10)
    at Module.load (node:internal/modules/cjs/loader:1124:32)
    at Module._load (node:internal/modules/cjs/loader:965:12)
    at f._load (node:electron/js2c/asar_bundle:2:13330)
    at o._load (node:electron/js2c/renderer_init:2:3109)
    at Module.require (node:internal/modules/cjs/loader:1148:19)
    at require (node:internal/modules/cjs/helpers:110:18)

See test case, just click on run test and open the devtools

require_bug.zip

Testcase Gist URL

No response

Additional Information

Might be related to: #37404

and maybe solved with #37506 however this fix seems to have not made it

@codebytere if you can have a look please, it is really stopping us from upgrading to 23+ versions of Electron.

@codebytere
Copy link
Member

codebytere commented Jun 12, 2023

Duplicate of #37404 - it's on my radar and updates will be posted there!

@codebytere codebytere closed this as not planned Won't fix, can't repro, duplicate, stale Jun 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants