monkey-patch: Monkey path not loading in VSCode 1.74.0
VSCode won’t start. I’m testing it on macOS 13.0.1
❯ code --version
1.74.0
5235c6bb189b60b01b1f49062f4ffa42384f8c91
x64
❯ code --verbose
Loading monkey-patch
(node:56390) UnhandledPromiseRejectionWarning: TypeError: Cannot read properties of undefined (reading 'crypto')
at P (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:25:24056)
at i (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:25:33504)
at get mainIPCHandle (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:32:6945)
at p.<computed> (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:3:53298)
at Oe.c (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:84:7310)
at Oe.b (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:84:5809)
at Oe.a (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:84:4864)
at Oe.main (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:84:4709)
at Object.<anonymous> (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js:85:1732)
at s._safeInvokeFunction (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:1337)
at s._invokeFactory (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:1522)
at s.complete (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:1801)
at s._onModuleComplete (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:1112)
at s._onModuleComplete (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:1358)
at s._resolve (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:510)
at s.defineModule (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:6066)
at n (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:10527)
at Object.R (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:6036)
at s._safeInvokeFunction (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:1337)
at s._invokeFactory (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:1522)
at s.complete (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:1801)
at s._onModuleComplete (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:1112)
at s._onModuleComplete (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:1358)
at s._resolve (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:510)
at s.defineModule (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:5:6066)
at y (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:6:1825)
at h (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:2554)
at Object.<anonymous> (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.nls.js:3:61)
at e._createAndEvalScript (/Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:2598)
at /Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/vs/loader.js:4:2237
at /Applications/Dev/Visual Studio Code.app/Contents/Resources/app/out/bootstrap-amd.js:82:14
at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)
(Use `Electron --trace-warnings ...` to show where the warning was created)
(node:56390) 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)
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 34
- Comments: 20
long story short there was a breaking change in 1.74. Either downgrade to 1,73, or disable monkeypatch + customize UI
(VSCodium’s main maintainer here) Some users are indicating that the current git version is working. So the extension might just need to be published on OpenVSX (I use https://github.com/HaaLeo/publish-vscode-extension)
In theory, if the Monkey patch was used only for CustomizeUI and a simple CSS customization, some of these customisations might be reproduced directly in
Contents/Resources/app/out/vs/workbench/workbench.desktop.main.css
. Of course, VSCode will throw a warning on start but at least it can be suppressed and won’t bother you till the next update of VSCode.+1 also having issues. I apply monkey patch and then VS Code won’t open after a restart. This is a monkey patch to hide the top bar.
Solution for now is to re-install the Mac app (download & overwrite .app file) and just not run the monkey patch.
I think this was explained here by the author: https://github.com/iocave/customize-ui/issues/156
Here’s a link to 1.73. On mac you just need to download this version and replace the
.app
in your applications folderI use monkey patch to customize fonts and font sizes for VSCode Explorer, Outline, Terminal. And also for other customization features. I will have to stay with 1.73 unless Monkey patch will be re-enabled in future versions of VSCode. I encourage MS to re-enable Monkey patch.
I use monkey-patch to hide the UI’s top bar. I’ve done so for years and can’t go back to the spammy top bar. I guess this means I’m on vsc 1.73 until there’s a workaround/fix or vsc itself lets you hide the top bar.
It happens to me as well in macOS. The only solution I found so far is to go back to vscode version 1.73.
NOTE: Cancel vs code auto update feature so I won’t force update to 1.74.
Looking at the customize ui thread started by the author it seems it is forever going to be broken because vscode changed a fundamental mechanic on how their typescript private fields are accessed. The only workaround for now is downgrading as far as I know
😢
😭
Ran into this today. Glad this thread was here to make me not feel insane 👍 a fix would be awesome