Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts-node no longer working with TypeScript@2.7 #527

Closed
rbuckton opened this issue Jan 25, 2018 · 2 comments
Closed

ts-node no longer working with TypeScript@2.7 #527

rbuckton opened this issue Jan 25, 2018 · 2 comments
Labels

Comments

@rbuckton
Copy link

ts-node has a dependency on an old api called parseConfigFile that was removed in 1.7. In TypeScript 2.7 a new internal parseConfigFile was added with a different signature for a different purpose and it seems that due to the order in which ts-node looks for an API to parse a tsconfig.json file.

Example:

npm i ts-node
node
> require("ts-node/register.js");
TypeError: host.onUnRecoverableConfigFileDiagnostic is not a function
    at Object.parseConfigFile (C:\dev\TypeScript\node_modules\typescript\lib\typescript.js:76999:18)
    at readConfig (C:\dev\TypeScript\node_modules\ts-node\src\index.ts:471:25)
    at Object.register (C:\dev\TypeScript\node_modules\ts-node\src\index.ts:205:18)
    at Object.<anonymous> (C:\dev\TypeScript\node_modules\ts-node\register\index.js:1:16)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)

I would recommend changing the order of feature testing to push the check for parseConfigFile later in the readConfig function above and first test for newer functionality, or check against the ts.version property to ensure the correct version.

@dragosbulugean
Copy link

TypeScript 2.7.1
ts-node 4.1.0

It is just stuck - doesn't do anything. Any clues as to why?

@blakeembrey
Copy link
Member

Thanks for your patience, I haven't had much time for OSS recently. I finally got to it with #536.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants