nonara / ts-patch

Augment the TypeScript compiler to support extended functionality
MIT License
766 stars 26 forks source link

Error on `ts-patch install` #54

Closed nikita-starostin closed 3 years ago

nikita-starostin commented 3 years ago

I have run:

npm i -D ts-patch
ts-patch install

and get an error: Could not recognize diagnostics signature in emitFilesAndReportErrors(). Please open an issue with your TS version #.

The ts version is 3.1.8 the command is running inside the project created with @angular/cli@7.1.4

the version had been determined from running tsc -v, however the angular project has typescript3.1.6 in package.json as dependency.

nikita-starostin commented 3 years ago

I have also tried to

npm i -D ts-patch@1.2.2.
ts-patch install

and had the same result

nikita-starostin commented 3 years ago

have done some debugging - have gone into the sources and find out where the error has been trown from, add some console log for more information:

image

so the check for modern ts failed, then check for ts2.7 also failed

the logged rest code shows the next: image expectations that highlighted string should be found with 2.7 check

as next step have debugged the regex on regex101.com: image from screen above the problem part is (\) which tries to find the call to emit function without parameters, e.g.

var _a = program.emit();
nonara commented 3 years ago

Ah, good catch. Thanks for the investigative work! Should be sorted in v1.4.2