Open kasi1999999 opened 1 year ago
Seems described in https://github.com/TypeStrong/ts-node/issues/1752
https://github.com/TypeStrong/ts-node/pull/1959 this unreleased at this moment fix from main
branch stops showing Uncaught SyntaxError: Unexpected token 'export'
but effect is same as if you would point --cwd to nowhere — doesn't resolve local modules and tsconfig.json, e.g.
ts-node --cwd `mktemp -d`
11.0.0-beta.1
has still this problem, even though the temporary file name is <repl>.cjs
, when compilerOptions.module
is ES2022
:
$npx ts-node --version
v11.0.0-beta.1
$ npx ts-node
> "foo"
/Users/goro-fuji/ghq/github.com/gfx/hello-typescript/<repl>.cts:3
export {};
^^^^^^
Uncaught SyntaxError: Unexpected token 'export'
>
Search Terms
ts-node esm
"Uncaught SyntaxError: Unexpected token 'export'"
Expected Behavior
REPL should work in package -
"type": "module",
Actual Behavior
I see last release v10.9.1 many months ago (Jul 14, 2022). Was this fixed? Why do I miss more recent releases? When this fix will be released? I read https://github.com/TypeStrong/ts-node/issues/1924, but still unable to get it work. I tried to use dependency
"ts-node": "github:TypeStrong/ts-node#main",
, but still getting:Steps to reproduce the problem
Minimal reproduction
Specifications
"name": "my-package", "type": "module", "devDependencies": { "ts-node": "github:TypeStrong/ts-node#main", "tslib": "^2.5.0", "typescript": "^5.0.4" } }