Skip to content

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

Open

Description

@akudev

Reported in #337

Activity

  1. added
    bugSomething isn't working
    ts-interface-generatorRelated to the ts-interface-generator sub-package
    on Mar 23, 2022
  2. self-assigned this
    on Mar 23, 2022
  3. Revest117 commented on Apr 1, 2022

    @Revest117

    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

  4. akudev commented on Apr 4, 2022

    @akudev
    MemberAuthor

    @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.

  5. akudev commented on Sep 23, 2024

    @akudev
    MemberAuthor

    With #474 being merged now the behavior will probably improve or at least change. With no constructor in the direct parent class, it will walk up further the class hierarchy. A crash should be prevented, but initially a wrong settings type may be used. I think this will be corrected after further runs of the generator. The "real" solution would be to first collect inheritance information to construct the proper interface generation order, but if this behaves benign, as assumed above, the importance of implementing this is reduced a bit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingts-interface-generatorRelated to the ts-interface-generator sub-package

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions