-
-
Notifications
You must be signed in to change notification settings - Fork 84
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
Issue/Feature request: unclear error when command
of custom script not found (manually configured node version)
#462
Comments
Running the sample script gives the same
"frontMatter.custom.scripts": [
{
"id": "sample",
"title": "Sample",
"script": "./scripts/sample.js",
"command": "node"
}
]
const arguments = process.argv;
if (arguments && arguments.length > 0) {
const workspaceArg = arguments[2]; // The workspace path
const fileArg = arguments[3]; // The file path
const frontMatterArg = arguments[4]; // Front matter data
console.log(`NOTIFICATION SUCCESS?!`);
} |
@rshmhrj it depends on how your VS Code instance is configured. That is also why you can provide a path to your node executable. |
Hi @estruyf , When I run "frontMatter.custom.scripts": [
{
"id": "sample",
"title": "Sample",
"script": "./scripts/sample.js",
"command": "/usr/local/bin/node"
}
] @davidsneighbour maybe try a full path to the executable instead of |
The path works in both ways. My issue was that the current version was NOT 18.0.0 but later, and the interface didn't indicate it. Seems to be more verbose in beta now and is working when configured properly. |
Describe the bug
Running a custom script with a configured command (node location) that does not exist results in an "undefined" error without much information. Looking at the output one can gleam that the node version does not exist, but not from the actual notification text.
To Reproduce
"~/.config/nvm/versions/node/v18.0.0/bin/node"
does not exist.shows:
The otuput console for frontmatter shows:
Running the script manually with the second line command results in:
(due to some re-installing and moving around we are at v18.12.1 ;)
You could reproduce it using my repo at github.com/davidsneighbour/kollitsch.dev - run
npm install
,npm build
and then open the workspace file open one of the "music to program to" posts incontent/2022/
. Click the custom script to retrieve the youtube image.Latest Frontmatter (non-beta), latest VSCode.
Long story short, one of the following applies :)
command
andscript
exists and throw a readable error if not. I know computation time at program start is scarce (or when the configuration is reloaded), but that would be a good time to complain about this :)The text was updated successfully, but these errors were encountered: