cevek / ttypescript

Over TypeScript tool to use custom transformers in the tsconfig.json

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot read property 'updateImportDeclaration' of undefined

tavisca-kbobade opened this issue · comments

I created a simple transformer to replace file content. But getting an error
Cannot read property 'updateImportDeclaration' of undefined.
It is because context.factory is null when I am using typescript@3.8.3 and when I install typescript@4.1.2 it works as expected.

Is there any other way instead of upgrading to typescript?

Closing this, as I think it is not related to ttypescript.

@tavisca-kbobade API functionality in TS pre-TS 4 is called through the Typescript instance.

ts 3: ts.updateImportDeclaration
ts 4+: factory.updateImportDeclaration