`nx release` command not working properly on windows
Current Behavior
Following this tutorial on the documentation of nx release, I noted that the commit for the release totally stop to work:
As a result, a botched release happens without any release, causing the git command to fail:
digging more into the cause, it seems that message is not parsing properly the message into "quotes" here:
https://github.com/nrwl/nx/blob/db10812da789cd48d3a722628a00feda9d0e3810/packages/nx/src/command-line/release/utils/git.ts#L263
One solution is to parse the string properly for --message:
by using JSON.stringify, we can parse properly the string being passed to --message... and pretty much it fixes the issue
Expected Behavior
it would be advisable to review how --message contents are being parsed . Using JSON.parse ensures that the script being passed, has double quotes as --messages needs it.
GitHub Repo
No response
Steps to Reproduce
run in a windows machine nx release --skip-publish --first-release --verbose. It will potentially fail in Nx 20
Nx Report
NX Report complete - copy this into the issue template
Node : 20.17.0 OS : win32-x64 Native Target : x86_64-windows npm : 10.8.2
nx (global) : 20.0.0 nx : 20.0.0 @nx/js : 20.0.0 @nx/jest : 20.0.0 @nx/eslint : 20.0.0 @nx/workspace : 20.0.0 @nx/devkit : 20.0.0 @nx/esbuild : 20.0.0 @nx/eslint-plugin : 20.0.0 @nx/node : 20.0.0 typescript : 5.5.4
Registered Plugins: @nx/eslint/plugin @nx/jest/plugin
Failure Logs
No response
Package Manager Version
npm
Operating System
- [ ] macOS
- [ ] Linux
- [x] Windows
- [ ] Other (Please specify)
Additional Information
No response
Hi @jaysoo let me know if we can connect and check this issue. Please feel free to DM me on Nx discord
I'm not saying you are wrong @ErickRodrCodes but the screenshots provided don't appear to be clear evidence of what you are saying.
I don't see any screenshot which shows an issue with the message.
You are showing that the message value is a string, and when we trace it through it is ultimately given as part of an array of strings to spawn from node:child_process.
Using the terminal output as evidence doesn't apply, because when you print a string it doesn't print surrounding quotes, so it's not actually related to how the value is consumed by the code.
Additionally, in your error screenshot, what I see is err = 'Debugger attached not clear evidence of a particular error in the Nx code.
Please can you update your screenshots to demonstrate the actual error you are experiencing? And can you confirm if this historically worked for you and recently stopped working, or if it has never worked for you?
Sure thing @JamesHenry , allow me to record a video instead.
This issue has been automatically marked as stale because no reproduction was provided within 7 days. Please help us help you. Providing a repository exhibiting the issue helps us diagnose and fix the issue. Any time that we spend reproducing this issue is time taken away from addressing this issue and other issues. This issue will be closed in 21 days if a reproduction is not provided. If a reproduction has been provided, please reply to keep it active. Thanks for being a part of the Nx community! 🙏
This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.