-
-
Notifications
You must be signed in to change notification settings - Fork 542
Closed
Milestone
Description
Expected Behavior
No error occured, and use the new register instance compile the .ts file once when create a new register instance to cover an old one, the old one may be created by third-party library(e.g. karma cli).
The reason for create a new register is that, I want to use a special RegisterOptions for .test.ts files.
Actual Behavior
By debugging the source code, I found that if create two register, the require.extensions[.ts] handler was nested registration by registerExtensions function twice. And the .ts file was compiled twice, the old register's output as the new register's input, then some error occured, like below:
TSError: ⨯ Unable to compile TypeScript:
error TS7022: '__awaiter' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
2 var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
......Steps to reproduce the problem
- First, create a
test.tsfor test the problem. - Then, create a
index.js, and create two register instances directly in order to simplify the problem, thenrequirethetest.tsfile. - Finally, run the
node index.jscommand.
Minimal reproduction
Specifications
- ts-node version: 9.0.0
- node version: 13.9.0
- TypeScript version: 4.0.5
- Operating system and version: win7-64bit
Metadata
Metadata
Assignees
Labels
No labels