iocave / monkey-patch

Inject custom javascript into vscode
MIT License
155 stars 17 forks source link

Monkey patch prevents startup: UnhandledPromiseRejectionWarning #59

Open RL-S opened 1 year ago

RL-S commented 1 year ago

VS Code doesn't launch with Monkey Patch applied. I'm using Monkey Patch for CustomizeUI.

code --version
1.74.0

Output of code --verbose:

code --verbose
Gtk-Message: 10:57:17.151: Failed to load module "appmenu-gtk-module"
[47250:1212/105717.175930:WARNING:bluez_dbus_manager.cc(248)] Floss manager not present, cannot set Floss enable/disable.
Loading monkey-patch
(node:47250) UnhandledPromiseRejectionWarning: TypeError: Cannot read properties of undefined (reading 'crypto')
    at P (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:25:24056)
    at i (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:25:33504)
    at get mainIPCHandle (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:32:6945)
    at p.<computed> (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:3:53298)
    at Oe.c (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:84:7310)
    at Oe.b (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:84:5809)
    at Oe.a (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:84:4864)
    at Oe.main (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:84:4709)
    at Object.<anonymous> (/usr/share/code/resources/app/out/vs/code/electron-main/main.js:85:1732)
    at s._safeInvokeFunction (/usr/share/code/resources/app/out/vs/loader.js:5:1337)
    at s._invokeFactory (/usr/share/code/resources/app/out/vs/loader.js:5:1522)
    at s.complete (/usr/share/code/resources/app/out/vs/loader.js:5:1801)
    at s._onModuleComplete (/usr/share/code/resources/app/out/vs/loader.js:6:1112)
    at s._onModuleComplete (/usr/share/code/resources/app/out/vs/loader.js:6:1358)
    at s._resolve (/usr/share/code/resources/app/out/vs/loader.js:6:510)
    at s.defineModule (/usr/share/code/resources/app/out/vs/loader.js:5:6066)
    at n (/usr/share/code/resources/app/out/vs/loader.js:5:10527)
    at Object.R (/usr/share/code/resources/app/out/vs/loader.js:6:6036)
    at s._safeInvokeFunction (/usr/share/code/resources/app/out/vs/loader.js:5:1337)
    at s._invokeFactory (/usr/share/code/resources/app/out/vs/loader.js:5:1522)
    at s.complete (/usr/share/code/resources/app/out/vs/loader.js:5:1801)
    at s._onModuleComplete (/usr/share/code/resources/app/out/vs/loader.js:6:1112)
    at s._onModuleComplete (/usr/share/code/resources/app/out/vs/loader.js:6:1358)
    at s._resolve (/usr/share/code/resources/app/out/vs/loader.js:6:510)
    at s.defineModule (/usr/share/code/resources/app/out/vs/loader.js:5:6066)
    at y (/usr/share/code/resources/app/out/vs/loader.js:6:1825)
    at h (/usr/share/code/resources/app/out/vs/loader.js:4:2554)
    at Object.<anonymous> (/usr/share/code/resources/app/out/vs/code/electron-main/main.nls.js:3:61)
    at e._createAndEvalScript (/usr/share/code/resources/app/out/vs/loader.js:4:2598)
    at /usr/share/code/resources/app/out/vs/loader.js:4:2237
    at /usr/share/code/resources/app/out/bootstrap-amd.js:82:14
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
(Use `code --trace-warnings ...` to show where the warning was created)
(node:47250) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)

Uninstalling and reinstalling vscode solves the issue, but removes Monkey Patch. Reapplying Monkey Patch then prevents startup again.

jay-hankins commented 1 year ago

See https://github.com/iocave/monkey-patch/issues/56#issuecomment-1345577152 and https://github.com/iocave/customize-ui/issues/156#issue-1453326130.

zawilliams commented 1 year ago

Happening to me too.