{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Example", | |
"type": "node", | |
"request": "launch", | |
"runtimeExecutable": "node", | |
"runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], | |
"args": ["src/script.ts", "--example", "hello"], | |
"cwd": "${workspaceRoot}", | |
"internalConsoleOptions": "openOnSessionStart", | |
"skipFiles": ["<node_internals>/**", "node_modules/**"] | |
} | |
] | |
} |
node-ter
You saved my life! thx!
ok
I've had the following config working forever without issue, but after upgrading to typescript 5 and apollo server 4, all of the sudden it doesn't like it anymore...
{ "version": "0.2.0", "configurations": [ { "name": "Server", "type": "node", "request": "launch", "runtimeExecutable": "node", "runtimeArgs": ["--nolazy", "-r", "ts-node/register/transpile-only"], "resolveSourceMapLocations": ["${workspaceFolder}/**", "!**/node_modules/**"], "args": ["src/index.ts"], "env": { "NODE_ENV": "local" }, "cwd": "${workspaceRoot}", "internalConsoleOptions": "openOnSessionStart", "skipFiles": ["<node_internals>/**", "node_modules/**"] } ] }
I end up getting this, which looks like it's not skipping the node_modules like it should
/node_modules/@apollo/server/dist/cjs/ApolloServer.js:70 const nodeEnv = config.nodeEnv ?? process.env.NODE_ENV ?? '';
Anyone else seen anything like this?
Thank you very much. I used your config to be able to debug typescript in neovim using dap.
no type checking and need to use tsconfig-paths to resolve paths
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"runtimeArgs": ["-r", "ts-node/register/transpile-only", "-r", "tsconfig-paths/register"],
"program": "${workspaceFolder}/packages/lerna/src/cli.js",
"args": ["version"],
"console": "integratedTerminal",
"cwd": "${workspaceFolder}",
"internalConsoleOptions": "neverOpen",
}
]
}
Error: Cannot find module 'ts-node/register/transpile-only'
fixed this by install ts-node locally
npm link ts-node // or yarn add -D ts-node
@iulo thanks,u save my day.
It actually worked without any problems from first try. Awesome!! 👍