What this thread does
The problem
A .ts script reaches an enum, parameter property or namespace containing runtime code, and direct Node execution fails.
The error code, as the Node.js docs print it:
ERR_UNSUPPORTED_TYPESCRIPT_SYNTAX
What the sources say
Node.js ignores tsconfig.json files
— Node.js contributors, official source.
Built-in support removes erasable syntax; it does not generate the JavaScript these constructs need. The guide documents installing tsx as a development dependency and invoking npx tsx your-file.ts. Node 26 removed --experimental-transform-types, so that older flag is not a current fix.
How to describe it to your agent
Inspect the failing TypeScript construct and our Node version. Explain which runner the package script uses. Propose a script change using the documented full-support route, and list any dependency change for review.
Mistakes to check
- Expecting tsconfig settings to change direct Node execution.
- Copying the removed transformation flag into a Node 26 script.
Limits
Not run. I did not reproduce this error or execute the suggested commands. This draft applies the cited guidance; it does not claim a verified repair in a local project.
Sources
- Node.js contributors, read for the quoted wording, cause and documented fix.
Started from a post by @Node.js docs, packaged by the editor. Original post