[ts-interface-generator] interface generation fails if application contains mixins
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- typescript
- Bereich
- tooling
Rechercherichtung
Start with the npx @ui5/ts-interface-generator command and a ClassC.ts containing extends ClassA(ClassB), reproducing the failure from @ui5/[email protected]. Compare this with the workaround using tsconfig-generate-ts-interfaces.json and --config; done means type generation succeeds without excluding files containing mixins.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Describe the bug
Running npx @ui5/ts-interface-generator command in project containing mixins causing following error:
AppData\Local\npm-cache\_npx\a388873ad1487e68\node_modules\@ui5\ts-interface-generator\dist\interfaceGenerationHelper.js:172
throw new Error(`Type '${typeNode.getText()}' referenced in ${sourceFile.fileName} in the inheritance clause '${heritageClause.getFullText()}' could not be resolved.
^
Error: Type 'ClassA(ClassB)' referenced in ClassC.ts in the inheritance clause ' extends ClassA(ClassB)' could not be resolved.
Check the respective line in the source code: ts there an error for this type? Make sure the type is properly imported.
If a working "import" is not possible and it is a UI5 type (or type from another library), the issue could be caused by the respective type definitions not being available. They must be found by the TypeScript compiler according to the configuration in tsconfig. To verify this step-by-step, you can do the following:
1. Check whether the (UI5 or other) types are added as dependency in package.json (or available as transitive dependency)
2. Check inside which "node_modules" folder the types are actually available - if they are not, check whether "npm install" (or "yarn" etc.) has run successfully - maybe re-run it
3. Check the "tsconfig.json" file: types outside the default "@types" package must be explicitly added in the "types" or "typeRoots" section. Is the name and path correct?
One known cause of this error is that the "typeRoots" setting in tsconfig.json has wrong paths, which are not actually pointing to the correct location of the type definitions.
Or is there a different reason why this type would not be known?
at AppData\Local\npm-cache\_npx\a388873ad1487e68\node_modules\@ui5\ts-interface-generator\dist\interfaceGenerationHelper.js:172:39
at Array.forEach (<anonymous>)
at AppData\Local\npm-cache\_npx\a388873ad1487e68\node_modules\@ui5\ts-interface-generator\dist\interfaceGenerationHelper.js:168:46
at Array.forEach (<anonymous>)
at AppData\Local\npm-cache\_npx\a388873ad1487e68\node_modules\@ui5\ts-interface-generator\dist\interfaceGenerationHelper.js:166:43
This happens whenever project contains file with mixin akin to:
export default class ClassC extends ClassA(ClassB) {
// ...
}
Current workaround is to have separate tsconfig-generate-ts-interfaces.json file which excludes files containin mixin, and pass this file to --config parameter of interface generator.
Expected behavior
Successful type generation for project containing mixins.
Additional context
Reproduced in @ui5/[email protected]
- Vorherrschende Sprache
- TypeScript
- Sterne
- 213
- Forks
- 35
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus UI5/typescript
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
UI5/typescript#625 · 4 Kommentare ·
-
dts-generator
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
UI5/typescript#529 · 3 Kommentare ·
-
Dependency DashboardOffen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 15/100
UI5/typescript#587 ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
UI5/typescript#532 ·
-
enhancement ts-interface-generator
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
UI5/typescript#524 ·
Ähnliche Issues
-
feature
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
ChromeDevTools/chrome-devtools-mcp#3689 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: Team (channel) avatars render noticeably smaller than agent avatars in the sidebar gridOffenbug from-app needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
nightly-labs/openbot#21303 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
ADORSYS-GIS/CoopData#282 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
OHDSI/Data2Evidence#3816 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
`ovsx verify` fails for a version older than the 100 newest of an extensionEvtl. vergeben @trivikr hat das heute übernommen. Offencli
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 81/100
eclipse-openvsx/openvsx#2482 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag