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] Conventional Commits: Cannot read properties of undefined (reading 'fsPath') #282

Closed
YXL76 opened this issue Nov 21, 2022 · 13 comments · Fixed by #267
Closed

[BUG] Conventional Commits: Cannot read properties of undefined (reading 'fsPath') #282

YXL76 opened this issue Nov 21, 2022 · 13 comments · Fixed by #267

Comments

@YXL76
Copy link
Contributor

YXL76 commented Nov 21, 2022

Describe the bug

Excuting extension.conventionalCommits failed.

async function getRepository({
git,
arg,
workspaceFolders,
}: {
git: VSCodeGit.API;
arg?: Arg;
workspaceFolders?: readonly vscode.WorkspaceFolder[];
}) {
const _arg = arg?._rootUri.fsPath;
output.info(`arg: ${_arg}`);

arg is { "w": "git", "x": "Git", "g": 2, "j": "", "q": true, "t": 0 }, no _rootUri in it.

Environment

Version: 1.74.0-insider (system 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.19045
Sandboxed: Yes

@unlsycn
Copy link

unlsycn commented Nov 21, 2022

the same problem.

@melMass
Copy link

melMass commented Nov 23, 2022

Same issue, tried on both mac and windows.
Running from the command palette works, I disable extensions auto update as it's not the first time I have an extension that stops working mid project. #262 is similar but they only mention the touchbar issue

@yi-Xu-0100
Copy link
Collaborator

type Arg = {
_rootUri: vscode.Uri;
};

The _rootUri is a built-in property of VS Code, and I don't know why it's missing.

Perhaps we can avoid this problem by giving a suitable default value, or by giving the user the option to set this value if they encounter this problem.

@YXL76
Copy link
Contributor Author

YXL76 commented Nov 24, 2022

The type should be vscode.Uri | undefined?
Will change const _arg = arg?._rootUri.fsPath; to const _arg = arg?._rootUri?.fsPath; break something? It works fine for me.

@yi-Xu-0100
Copy link
Collaborator

@YXL76 Do you mean to change these two contents?

-   _rootUri: vscode.Uri; 
+   _rootUri: vscode.Uri | undefined; 

...

-   const _arg = arg?._rootUri.fsPath;
+   const _arg = arg?._rootUri?.fsPath;

@YXL76
Copy link
Contributor Author

YXL76 commented Nov 24, 2022

@YXL76 Do you mean to change these two contents?

-   _rootUri: vscode.Uri; 
+   _rootUri: vscode.Uri | undefined; 

...

-   const _arg = arg?._rootUri.fsPath;
+   const _arg = arg?._rootUri?.fsPath;

yes

@yi-Xu-0100
Copy link
Collaborator

@YXL76 Would you be willing to submit a PR to fix this issue and I'll let the action execute to generate a beta version for testing? 😊

@yi-Xu-0100
Copy link
Collaborator

Thanks @YXL76 , @melMass @unlsycn Try the beta extension to check it. 😊

@unlsycn
Copy link

unlsycn commented Nov 24, 2022

Thanks @YXL76 , @melMass @unlsycn Try the beta extension to check it. 😊

It seems work fine thx

@Alfian5229
Copy link

so when its going live?

@yi-Xu-0100
Copy link
Collaborator

@Alfian5229 If there is no other problem about it, it will be release on this friday. 😊

@melMass
Copy link

melMass commented Dec 8, 2022

Works fine for me too!
waiting for the release 🚀

@yi-Xu-0100
Copy link
Collaborator

All subscribers, a new version that fixes this issue has been released~ 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants