Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts-interface-generator: crash when parent class is also custom and has no constructors added yet #346

Open
akudev opened this issue Mar 23, 2022 · 2 comments
Assignees
Labels
bug Something isn't working ts-interface-generator Related to the ts-interface-generator sub-package

Comments

@akudev
Copy link
Contributor

akudev commented Mar 23, 2022

Reported in #337

@akudev akudev added bug Something isn't working ts-interface-generator Related to the ts-interface-generator sub-package labels Mar 23, 2022
@akudev akudev self-assigned this Mar 23, 2022
@Revest117
Copy link

Hi,

i have a similar error:

C:\Users\heess_k\Documents\TypeScript Projects\ui5-typescript-helloworld\node_modules\@ui5\ts-interface-generator\dist\interfaceGenerationHelper.js:97
                                throw new Error(`${statement.name ? statement.name.text : ""} inherits from ${interestingBaseClass} but the parent class ${typeChecker.getFullyQualifiedName(type.getSymbol())} seems to have no settings type`);
                                ^

Error: App inherits from EventProvider but the parent class "sap/ui/core/mvc/Controller".Controller seems to have no settings type
    at C:\Users\heess_k\Documents\TypeScript Projects\ui5-typescript-helloworld\node_modules\@ui5\ts-interface-generator\dist\interfaceGenerationHelper.js:97:39
    at Array.forEach (<anonymous>)
    at C:\Users\heess_k\Documents\TypeScript Projects\ui5-typescript-helloworld\node_modules\@ui5\ts-interface-generator\dist\interfaceGenerationHelper.js:69:46
    at Array.forEach (<anonymous>)
    at C:\Users\heess_k\Documents\TypeScript Projects\ui5-typescript-helloworld\node_modules\@ui5\ts-interface-generator\dist\interfaceGenerationHelper.js:67:43
    at Array.forEach (<anonymous>)
    at getManagedObjects (C:\Users\heess_k\Documents\TypeScript Projects\ui5-typescript-helloworld\node_modules\@ui5\ts-interface-generator\dist\interfaceGenerationHelper.js:63:27)
    at generateInterfaces (C:\Users\heess_k\Documents\TypeScript Projects\ui5-typescript-helloworld\node_modules\@ui5\ts-interface-generator\dist\interfaceGenerationHelper.js:39:17)
    at C:\Users\heess_k\Documents\TypeScript Projects\ui5-typescript-helloworld\node_modules\@ui5\ts-interface-generator\dist\generateTSInterfaces.js:133:60
    at Array.forEach (<anonymous>)
The terminal process "C:\WINDOWS\System32\cmd.exe /d /c npm run watch:controls" terminated with exit code: 1.

I used the demo project in the custom-controls branch:
ui5-typescript-helloworld

akudev added a commit that referenced this issue Apr 4, 2022
To generate constructor signatures, a settings type needs to be created
which inherits from the
parent class' settings type and adds the properties, aggregations etc.
of the current class. This
rightly leads to an error. But this should not lead to an error when the
class does not add any API
items at all.

related to #346
@akudev
Copy link
Contributor Author

akudev commented Apr 4, 2022

@Revest117: thanks for reporting! This particular issue where the settings type is missing but actually not needed at all is now fixed in the newly released version 0.4.2.

The overall issue when e.g. two custom controls inherit from each other and are added at the same time is still open, so I'll keep this issue report open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ts-interface-generator Related to the ts-interface-generator sub-package
Projects
None yet
Development

No branches or pull requests

2 participants