You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When invoking custom actions using Node.js, the arguments passed are mishandled on Windows. Specifically:
Paths to scripts are not escaped, leading to issues when directory names contain spaces.
The JSON argument for front matter, when escaped with single quotes, behaves differently between macOS and Windows. On Windows, the argument loses its double quotes when passed, causing JSON.parse to fail.
Additionally, the command node does not recognize globally installed packages, necessitating absolute paths to libraries in scripts.
To Reproduce
Steps to reproduce the behavior:
Set up a custom action in Node.js.
Provide a script path that contains spaces.
Pass a JSON front matter argument enclosed with single quotes.
Run the custom action on both macOS and Windows.
Observe that on Windows, the script may fail due to spaces in the directory name and JSON.parse will throw an error due to the missing double quotes in the JSON argument.
Also, note the inability to recognize globally installed packages.
Expected behavior
Arguments should be consistently and correctly passed to custom actions across different operating systems. Paths should be escaped to handle spaces, and JSON arguments should retain their original formatting. Also, globally installed Node.js packages should be recognized without the need for absolute paths.
Screenshots
N/A
Desktop (please complete the following information):
Windows 10 & 11 (x64), MacOs 13.5 (Apple Silicon)
Additional context
I am using version 8.4.0 of the software.
The text was updated successfully, but these errors were encountered:
I have added a fix for the paths with spaces and JSON arguments on Windows.
About the node command not recognizing globally installed packages, this is a configuration on the local machine. By default, node will not retrieve global modules; you must ensure the global node_modules folder is set in the path environment variable. Check StackOverflow issue for more information.
Describe the bug
When invoking custom actions using Node.js, the arguments passed are mishandled on Windows. Specifically:
JSON.parse
to fail.node
does not recognize globally installed packages, necessitating absolute paths to libraries in scripts.To Reproduce
Steps to reproduce the behavior:
JSON.parse
will throw an error due to the missing double quotes in the JSON argument.Expected behavior
Arguments should be consistently and correctly passed to custom actions across different operating systems. Paths should be escaped to handle spaces, and JSON arguments should retain their original formatting. Also, globally installed Node.js packages should be recognized without the need for absolute paths.
Screenshots
N/A
Desktop (please complete the following information):
Additional context
I am using version 8.4.0 of the software.
The text was updated successfully, but these errors were encountered: