Update VSCode launch.json debugging configuration in README.md#576
Open
saiki987 wants to merge 1 commit intofacebook:mainfrom
Open
Update VSCode launch.json debugging configuration in README.md#576saiki987 wants to merge 1 commit intofacebook:mainfrom
saiki987 wants to merge 1 commit intofacebook:mainfrom
Conversation
Daniel15
reviewed
Dec 19, 2023
| "outFiles": [] | ||
| "outFiles": [], | ||
| "windows": { | ||
| "program": "${workspaceRoot}/node_modules/jscodeshift/bin/jscodeshift.js", |
Member
There was a problem hiding this comment.
Try ${workspaceRoot}/node_modules/.bin/jscodeshift.cmd and see if that works - for more consistency with how it's done for other platforms.
Author
There was a problem hiding this comment.
Thank you for your reply.
When I tried to launch debugger using it, I got the following error in DEBUG CONSOLE:
C:\Program Files\Volta\node.exe --nolazy .\node_modules\.bin\jscodeshift.cmd --dry --print -t transform.js --parser babel --run-in-band target.js
Uncaught SyntaxError .\node_modules\.bin\jscodeshift.cmd:1
@IF EXIST "%~dp0\node.exe" (
^
SyntaxError: Invalid or unexpected token
at internalCompileFunction (node:internal/vm:73:18)
at wrapSafe (node:internal/modules/cjs/loader:1178:20)
at <anonymous> (node:internal/modules/cjs/loader:1220:27)
at <anonymous> (node:internal/modules/cjs/loader:1310:10)
at <anonymous> (node:internal/modules/cjs/loader:1119:32)
at <anonymous> (node:internal/modules/cjs/loader:960:12)
at executeUserEntryPoint (node:internal/modules/run_main:81:12)
at <anonymous> (node:internal/main/run_main_module:23:47)
Process exited with code 1
It seems that vscode runs .\node_modules\.bin\jscodeshift.cmd using node.
When I ran .\node_modules\.bin\jscodeshift.cmd --dry --print -t transform.js --parser babel --run-in-band target.js it was successfull but I couldn't find any settings in launch.json to do this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When debugging via the VSCode on Windows 11, I got the following error:
I found the solution here and confirmed the new configuration works correctly.