Cannot read property 'updateImportDeclaration' of undefined
tavisca-kbobade opened this issue · comments
Kiran Bobade commented
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?
Kiran Bobade commented
Closing this, as I think it is not related to ttypescript.
Ron Spickenagel commented
@tavisca-kbobade API functionality in TS pre-TS 4 is called through the Typescript instance.
ts 3: ts.updateImportDeclaration
ts 4+: factory.updateImportDeclaration