Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: Cannot read properties of undefined (reading 'startsWith')

so when I try to commit my files through VS Code GUI i get this error.

TypeError: Cannot read properties of undefined (reading 'startsWith') at calculateDefaultProjectName (c:\Users\USername\projectname\node_modules\nx\src\command-line\run-one.js:101:31) at parseRunOneOptions (c:\Users\Username\gprojectname\node_modules\nx\src\command-line\run-one.js:56:32) at Object.<anonymous> (c:\Users\Username\projectname\node_modules\nx\src\command-line\run-one.js:20:22) at Generator.next (<anonymous>) at fulfilled (c:\Users\Username\projectname\node_modules\tslib\tslib.js:164:62) at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node Version: 18

I was trying to commit my files but sadly unsuccesfuly so. The strange think is when i try to commit through VS CLI it works fine. I only get this problem when I try to commit through VS Code GitCommit GUI.

enter image description here

like image 924
Dajlan Zaimaj Avatar asked Nov 28 '25 19:11

Dajlan Zaimaj


1 Answers

In my case the reason was that the package.json was saved in non UTF!

Resaving the file in UTF resolved the issue.

like image 185
BluesMan Alpha Avatar answered Nov 30 '25 10:11

BluesMan Alpha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!