问题
I am having issues using the "entity" sub generator when attempting to update an existing entity.
When running the generator, at the end of the process, the following command is run:
yarn run cleanup && yarn run webpack:build:main
During this process I get these errors:
ERROR in [at-loader] dummy/path/car-delete-dialog.component.ts:58:23 TS2559: Type 'typeof CarDeleteDialogComponent' has no properties in common with type 'Component'.
ERROR in [at-loader] ./dummy/path/car-dialog.component.ts:147:27 TS2559: Type 'typeof CarDialogComponent' has no properties in common with type 'Component'.
ERROR in [at-loader] ./dummy/path/car-dialog.component.ts:150:27 TS2559: Type 'typeof CarDialogComponent' has no properties in common with type 'Component'.
Which can be fixed by changing:
his.modalRef = this.carPopupService
.open(CarDialogComponent, params['id']);
to:
this.modalRef = this.carPopupService
.open(CarDialogComponent as Component, params['id']);
These errors are just related to the entity that has been updated.
I understand why this has to be done but am unsure if this is something the generator etc should deal with.
JHipster version is 4.6.2 (I recently updated it) and I've not used the sub generator before as originally did an import from JDL studio.
Thanks in advance for any help you can give.
回答1:
This has been resolved now.
I had a mismatch between the version the project was upgraded to (v4.6.2) and the global JHipster Generator (v4.6.1).
Updating the JHipster Generator version to v4.6.2 resolved the issues.
来源:https://stackoverflow.com/questions/45290211/jhipster-entity-sub-generator-no-properties-in-common-with-type-component