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
Building off of #1202, we know the maximum "target" you can use for the given node version, so we can log a helpful warning when your target is wrong:
Warning: You are using a "target" option that may be incompatible with your node version.
For node vXYZ we recommend "target": "es2018" or lower.
To disable this warning, add the following to your tsconfig:
"ts-node": {"disableNodeCompatibilityWarnings": true}
To override your "target" within ts-node, add the following to your tsconfig:
"ts-node": {"compilerOptions": {"target": "es2018"}}
To derive your tsconfig from a recommended set of options, add the following to your tsconfig:
"extends": "ts-node/node12/tsconfig.json"
Questions
Should this warning be logged for programmatic usage? For ts-node/register? For --loader ts-node/esm? I don't think libraries should send output to stderr, but ts-node/register is a weird case because it's almost exclusively used from the CLI.
Should the disableNodeCompatibilityWarnings option be renamed to allow more than 2 modes?
in auto / enabled mode, we override the "target" option with an appropriate value.
The text was updated successfully, but these errors were encountered:
cspotcode
changed the title
Warning when "target" is too high for the node version
Log warning when "target" is too high for the node version
Feb 26, 2021
Blocked by #1445
Building off of #1202, we know the maximum "target" you can use for the given node version, so we can log a helpful warning when your target is wrong:
Questions
ts-node/register
? For--loader ts-node/esm
? I don't think libraries should send output to stderr, butts-node/register
is a weird case because it's almost exclusively used from the CLI.disableNodeCompatibilityWarnings
option be renamed to allow more than 2 modes?The text was updated successfully, but these errors were encountered: