@ui5/ts-interface-generator: fails with older TS versions < 4.8
akudev opened this issue · 1 comments
akudev commented
When TypeScript version 4.7 or below is used, generation fails with one of the following errors:
TypeError: Cannot create property 'pos' on string '$ExampleSettings'
at setTextRangePos ...
Error: Debug Failure. Unhandled SyntaxKind: Unknown.
at pipelineEmitWithHintWorker ...
The reason is an incompatible change of the TypeScript compiler API in factory.createInterfaceDeclaration(...)
and factory.createParameterDeclaration(...)
(first parameter was removed).
Solution: use TypeScript 4.8 or higher.
I don't think the issue is worth working around anymore, although a version check and adding a parameter would theoretically be possible.
akudev commented
I couldn't resist. Fixed. Generator should run with all versions from at least TS 4.5 onwards. Tested also with the upcoming version 5.1's release candidate.