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
C:\Program Files\nodejs\node.exe: bad option: --project ../../scripts/tsconfig.json
On the other hand, if I omit the --project part and only have
"args": ["scripts/precompile.ts"],
then the command fails with the same error that I would get if I omitted --project on the commandline. The error is
import fs from 'fs-extra';
^^
SyntaxError: Unexpected identifier
and results from my top-level tsconfig.json targeting a different type of module -- which is why I created the separate tsconfig in the first place, for tsnode's usage.
Is there any way to pipe this through to the VSCode launch config?
Thanks!
The text was updated successfully, but these errors were encountered:
You need to use environment variables for this. Node.js doesn't understand ts-node arguments directly, so we have a "backdoor" via environment variables. In VS Code, you can set environment variables through the launch.json. There's some (not great) documentation in https://code.visualstudio.com/Docs/editor/debugging, I think it should look something like: "env": { "TS_NODE_PROJECT": "path-here" } (not tested).
Yep, that worked beautifully! Thanks, @blakeembrey! Added PR #738 to make a note of this in the readme, if you think that would be useful to have there.
Note sure if it's a feature gap or a documentation bug -- but I have been unable to use VS Code debugging for my use case.
If I run tsnode on the commandline or from script in
package.json
, it works beautifully:However, when I tried to put it into a VS Code launch config, such as this:
It fails with
On the other hand, if I omit the
--project
part and only havethen the command fails with the same error that I would get if I omitted
--project
on the commandline. The error isand results from my top-level
tsconfig.json
targeting a different type ofmodule
-- which is why I created the separate tsconfig in the first place, for tsnode's usage.Is there any way to pipe this through to the VSCode launch config?
Thanks!
The text was updated successfully, but these errors were encountered: