From f03f09dd040f850cb80c16c6507b1a5ba30eb4a5 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Wed, 29 Jul 2020 15:04:15 -0400 Subject: [PATCH] fix #1075 (#1086) * fix #1075 * Update README.md * Update README.md * Update README.md --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bf4d7174..282fdf13b 100644 --- a/README.md +++ b/README.md @@ -224,7 +224,11 @@ Any error that is not a `TSError` is from node.js (e.g. `SyntaxError`), and cann ### Import Statements -Current node.js stable releases do not support ES modules. Additionally, `ts-node` does not have the required hooks into node.js to support ES modules. You will need to set `"module": "commonjs"` in your `tsconfig.json` for your code to work. +There are two options when using `import` statements: compile them to CommonJS or use node's native ESM support. + +To compile to CommonJS, you must set `"module": "CommonJS"` in your `tsconfig.json` or compiler options. + +Node's native ESM support is currently experimental and so is `ts-node`'s ESM loader hook. For usage, limitations, and to provide feedback, see [#1007](https://github.com/TypeStrong/ts-node/issues/1007). ## Help! My Types Are Missing!