askpass-main.js TypeError: Cannot read properties of undefined (reading 'replace')
See original GitHub issueMight already have a duplicate issue but I did not find one, so I am reporting this (again) here.
Does this issue occur when all extensions are disabled?: Yes
- VS Code Version:
- OS Version:
Version: 1.74.0-insider (user setup)
Commit: 1b1e2a2c5794df1f475976062c754651827634a9
Date: 2022-11-18T05:25:18.342Z
Electron: 19.1.3
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Windows_NT x64 10.0.22621
Sandboxed: Yes
Steps to Reproduce:
- Open a WSL2 project whose git remote url is ssh-based (not http-based)
- Make sure
ssh-agent
has no credential remembered (aka. the next ssh will require password prompt) - Click the Commit button in vscode
- Shows an error dialog, whose git error output is:
> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file - -S
error: /home/username/.vscode-server-insiders/bin/1b1e2a2c5794df1f475976062c754651827634a9/extensions/git/dist/askpass-main.js:1
(()=>{"use strict";var e={4516:(e,s,r)=>{Object.defineProperty(s,"__esModule",{value:!0}),s.IPCClient=void 0;const t=r(8605);s.IPCClient=class{constructor(e){this.handlerName=e;const s=process.env.VSCODE_GIT_IPC_HANDLE;if(!s)throw new Error("Missing VSCODE_GIT_IPC_HANDLE");this.ipcHandlePath=s}call(e){const s={socketPath:this.ipcHandlePath,path:`/${this.handlerName}`,method:"POST"};return new Promise(((r,n)=>{const o=t.request(s,(e=>{if(200!==e.statusCode)return n(new Error(`Bad status code: ${e.statusCode}`));const s=[];e.on("data",(e=>s.push(e))),e.on("end",(()=>r(JSON.parse(Buffer.concat(s).toString("utf8")))))}));o.on("error",(e=>n(e))),o.write(JSON.stringify(e)),o.end()}))}}},5747:e=>{e.exports=require("fs")},8605:e=>{e.exports=require("http")}},s={};function r(t){var n=s[t];if(void 0!==n)return n.exports;var o=s[t]={exports:{}};return e[t](o,o.exports,r),o.exports}var t={};(()=>{var e=t;Object.defineProperty(e,"__esModule",{value:!0});const s=r(5747),n=r(4516);function o(e){console.error("Missing or invalid credentials."),console.error(e),process.exit(1)}!function(e){if(!process.env.VSCODE_GIT_ASKPASS_PIPE)return o("Missing pipe");if(!process.env.VSCODE_GIT_ASKPASS_TYPE)return o("Missing type");if("https"!==process.env.VSCODE_GIT_ASKPASS_TYPE&&"ssh"!==process.env.VSCODE_GIT_ASKPASS_TYPE)return o(`Invalid type: ${process.env.VSCODE_GIT_ASKPASS_TYPE}`);if("fetch"===process.env.VSCODE_GIT_COMMAND&&process.env.VSCODE_GIT_FETCH_SILENT)return o("Skip silent fetch commands");const r=process.env.VSCODE_GIT_ASKPASS_PIPE,t=process.env.VSCODE_GIT_ASKPASS_TYPE,i="https"===t?e[2]:e[3];let c,a,p;"https"===t&&(c=e[4].replace(/^["']+|["':]+$/g,"")),"ssh"===t&&(/passphrase/i.test(i)?a=e[6].replace(/^["']+|["':]+$/g,""):(c=e[6].replace(/^["']+|["':]+$/g,""),p=e[15])),new n.IPCClient("askpass").call({askpassType:t,request:i,host:c,file:a,fingerprint:p}).then((e=>{s.writeFileSync(r,e+"\n"),setTimeout((()=>process.exit(0)),0)})).catch((e=>o(e)))}(process.argv)})();var n=exports;for(var o in t)n[o]=t[o];t.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})();
TypeError: Cannot read properties of undefined (reading 'replace')
at /home/username/.vscode-server-insiders/bin/1b1e2a2c5794df1f475976062c754651827634a9/extensions/git/dist/askpass-main.js:1:1709
at /home/username/.vscode-server-insiders/bin/1b1e2a2c5794df1f475976062c754651827634a9/extensions/git/dist/askpass-main.js:1:1966
at /home/username/.vscode-server-insiders/bin/1b1e2a2c5794df1f475976062c754651827634a9/extensions/git/dist/askpass-main.js:1:1982
at Object.<anonymous> (/home/username/.vscode-server-insiders/bin/1b1e2a2c5794df1f475976062c754651827634a9/extensions/git/dist/askpass-main.js:1:2088)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module
fatal: failed to write commit object
Issue Analytics
- State:
- Created 10 months ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
TypeError: Cannot read property 'replace' of Undefined in JS
The "Cannot read property 'replace' of undefined" error occurs when calling the `replace()` method on a variable that stores an `undefined` value.
Read more >vscode cannot read properties of undefined (reading 'replace')
I've ran into a strange problem in my React Native app. I'm trying to check if an input value is NaN, where I...
Read more >Uncaught TypeError: Cannot read properties of undefined ...
In your example Uncaught TypeError: Cannot read properties of undefined (reading 'replace' ) can occur only if your variables song and/or ...
Read more >[SOLVED] Cannot Read Property 'replace' of Undefined in JS
This error occurs when you attempt to call the replace() method on a variable that has a value of undefined . const str...
Read more >Get JS ej2.min.js Cannot read properties of undefined ...
Debugging browser can view this error: Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'replace'). Could you help ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
FYI I am signing my commit using my ssh key, not GPG key
Version: 1.74.1 (Universal)