Closed sbouchex closed 11 months ago
@sbouchex can you post a jhipster info
output at the issue description?
We have ci workflow to check samples generated with by jhipster info
.
lignedurgence@0.0.1-SNAPSHOT D:\dev\sgdf\ligne-urgence-v2
`-- generator-jhipster@8.0.0-rc.1
.yo-rc.json
file generated in the root folder{ "generator-jhipster": { "applicationType": "monolith", "authenticationType": "oauth2", "baseName": "lignedurgence", "buildTool": "maven", "cacheProvider": "ehcache", "clientFramework": "angular", "clientTestFrameworks": [], "clientTheme": "cosmo", "clientThemeVariant": "primary", "creationTimestamp": 1697399864499, "databaseType": "sql", "devDatabaseType": "mariadb", "devServerPort": 4200, "enableGradleEnterprise": null, "enableHibernateCache": true, "enableSwaggerCodegen": false, "enableTranslation": true, "entities": [ "Saison" ], "gradleEnterpriseHost": null, "jhipsterVersion": "8.0.0-rc.1", "languages": [ "fr", "en" ], "lastLiquibaseTimestamp": 1697400191000, "messageBroker": false, "microfrontend": null, "microfrontends": [], "nativeLanguage": "fr", "packageName": "fr.sgdf.lignedurgence", "prodDatabaseType": "mariadb", "reactive": false, "searchEngine": "elasticsearch", "serverPort": null, "serverSideOptions": [ "searchEngine:elasticsearch" ], "serviceDiscoveryType": false, "skipUserManagement": true, "testFrameworks": [], "websocket": false, "withAdminUi": true } }
openjdk version "21" 2023-09-19 LTS OpenJDK Runtime Environment Temurin-21+35 (build 21+35-LTS) OpenJDK 64-Bit Server VM Temurin-21+35 (build 21+35-LTS, mixed mode, sharing)
git version 2.30.0.windows.2
node: v18.17.1 npm: 9.8.0
'docker' command could not be found
entityName.json
files generated in the .jhipster
directoryentity Saison { nom String required unique maxlength(100) debut Instant required fin Instant required emailEnvoi Boolean required }
I had the same error. When I comment out the line __jhiTransformTranslate__('myappApp.myEntity.delete.question', { "id": "{{ myEntity.id }}" })
in the file src/main/webapp/app/entities/my-entity/delete/my-entity-delete-dialog.component.html
then the applications compiles again normally.
JHipster has completed the sample check
.yo-rc.json
: valid
Entities JDL: valid
Application: successfully generated
Frontend check: success
Backend check: success
E2E check: skipped
Seems to be windows only. CI succeed with the sample.
Unfortunately, I believe I've also encountered the error on my local Mac. It seems difficult to reproduce, but I'll investigate it.
Is this duplicated of https://github.com/jhipster/generator-jhipster/issues/23939?
Same error for me (on windows with Angular frontend); solved removing the single curly brackets:
__jhiTransformTranslate__('vehiclemanagerApp.vehicles.delete.question', "id": "{{ vehicles.id }}" )
I don't have the issue of disappearing column names, only not compiling
__jhiTransformTranslate__
should not exist in generated code.
Closing as duplicated of https://github.com/jhipster/generator-jhipster/issues/23939.
If the problem persist, let me know.
__jhiTransformTranslate__
should not exist in generated code
... but id does!
It is in the file
C:\Users\#####\git\myapp\src\main\webapp\app\entities\types\myentityname\myentityname-delete-dialog.component.html
File is generated by
jhipster import-jdl myentitiesfile.jdl
I have enabled translation in initial jhipster generation command:
"languages": ["en", "fr", "it"], "nativeLanguage": "en",
__jhiTransformTranslate__
should not exist in generated code... but id does! It is in the file
C:\Users\#####\git\myapp\src\main\webapp\app\entities\types\myentityname\myentityname-delete-dialog.component.html
File is generated byjhipster import-jdl myentitiesfile.jdl
I have enabled translation in initial jhipster generation command:"languages": ["en", "fr", "it"], "nativeLanguage": "en",
If it does, it’s fixed in main.
Thank you! But... you mean it will be solved or it is solved in another JHipster version (I have 8.0.0-rc.1)?
You can use main npm install -g jhipster/generator-jhipster#main
or wait for a new release.
Would be nice if you could test if it works for you.
I tried with
npm install jhipster/generator-jhipster#main
and I got the same error.
The -g switch gave me errors i couldn't resolve in any way :-(
Hello, I'm new to jhipster, I made a simple project to learn Jhipster and I have the same error.
I made a JDL with JDL-studio.
entity User {
login String required,
password String required,
firstName String,
lastName String,
email String required unique,
activated Boolean,
lang String,
createdBy String,
createdDate Instant,
lastModifiedBy String,
lastModifiedDate Instant
}
entity Plant {
name String required,
origin String,
paidPrice Double,
photo ImageBlob,
}
relationship ManyToOne {
Plant{user} to User
}
I then used jhipster import-jdl jdl/0.jdl
.
Jhipster generated this html file :
<form *ngIf="plant" name="deleteForm" (ngSubmit)="confirmDelete(plant.id!)">
<div class="modal-header">
<h4 class="modal-title" data-cy="plantDeleteDialogHeading" jhiTranslate="entity.delete.title">
__jhiTransformTranslate__('entity.delete.title')
</h4>
<button type="button" class="btn-close" data-dismiss="modal" aria-hidden="true" (click)="cancel()">×</button>
</div>
<div class="modal-body">
<jhi-alert-error></jhi-alert-error>
<p id="jhi-delete-plant-heading" jhiTranslate="testjhipsterApp.plant.delete.question" [translateValues]="{ id: plant.id }">
__jhiTransformTranslate__('testjhipsterApp.plant.delete.question', { "id": "{{ plant.id }}" })
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="cancel()">
<fa-icon icon="ban"></fa-icon> <span jhiTranslate="entity.action.cancel">__jhiTransformTranslate__('entity.action.cancel')</span>
</button>
<button id="jhi-confirm-delete-plant" data-cy="entityConfirmDeleteButton" type="submit" class="btn btn-danger">
<fa-icon icon="times"></fa-icon> <span jhiTranslate="entity.action.delete"
>__jhiTransformTranslate__('entity.action.delete')</span
>
</button>
</div>
</form>
witch generate the same error :
src/main/webapp/app/entities/plant/delete/plant-delete-dialog.component.html:29:1 - error NG5002: Invalid ICU message. Missing '}'.
src/main/webapp/app/entities/plant/delete/plant-delete-dialog.component.html:29:1 - error NG5002: Unexpected character "EOF" (Do you have an unescaped "{" in your template? Use "{{ '{' }}") to escape it.)
Wasn't expecting Jhipster to generate file with problems...
npm install -g jhipster/generator-jhipster#main
finish with an error :
npm ERR! npm ERR!
npm ERR! npm ERR!
npm ERR! npm ERR! > generator-jhipster@8.0.0-rc.1 compile
npm ERR! npm ERR! > tsc
npm ERR! npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! 'tsc' is not recognized as an internal or external command,
npm ERR! npm ERR! operable program or batch file.
I tried with previous versions of the Jhipster as well. This issue is still there.
I've just tried, it's working as expected using git main. If there is a way to reproduce using main let me know.
I don't know what to say... i installed #main on win10, java 17.0.8+9-LTS-211, node 20.9.0 LTS This is the jdl imported
entity Vehicles {
plate String required unique
color String
}
entity Types {
name String required unique
}
entity Optionals {
name String required unique
}
relationship OneToMany {
Types to Vehicles{type required}
}
relationship ManyToMany {
Vehicles{optional} to Optionals{vehicle}
}
service * with serviceImpl
and this is the yo-rc file after import .yo-rc.json
In the C:\Users#####\git\vehiclemanager\src\main\webapp\app\entities folders of the generated entities i found the errors like
__jhiTransformTranslate__('vehiclemanagerApp.vehicles.delete.question', { "id": "{{ vehicles.id }}" } )
Is there a way to know what exact version of generator i'm running tho be sure i'm running #main?
Thank you for your support, if you need more information please let me know!
@mshima
If I'm not wrong, in #main generator you still have the cause of the problem line 29 in file
https://github.com/jhipster/generator-jhipster/blob/main/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/delete/_entityFile_-delete-dialog.component.html.ejs
@ettolo still not reproducible. Have you build the project after checking out or used the jit binary? https://github.com/jhipster/generator-jhipster/blob/main/CONTRIBUTING.md#set-jhipster-command-to-use-the-cloned-project
@mshima
If I'm not wrong, in #main generator you still have the cause of the problem line 29 in file
https://github.com/jhipster/generator-jhipster/blob/main/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/delete/_entityFile_-delete-dialog.component.html.ejs
They are replaced at generation time.
@mshima thank you, using cloned jhipster made the trick, I have really appreciated your support
@mshima Thank you. Cloning the repo as suggested above resolved the issue. I am seeing one issue with the generated entities. Labels are not getting resolved. UI shows error "Translation missing for xxxxx".
I guess some constants file path is not being resolved. Any clue?
I saw something similar with i18n recently. Refreshing the page fixed it.
This issue started happening for me once i changed the Entity holding images from String type to ImageBlob.
I'm getting this with issue on 8.1.0
@if (hallImage) { <form name="deleteForm" (ngSubmit)="confirmDelete(hallImage.id!)">
<div class="modal-body">
<jhi-alert-error></jhi-alert-error>
<p id="jhi-delete-hallImage-heading">Are you sure you want to delete Hall Image {{ hallImage.id }}?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="cancel()">
<fa-icon icon="ban"></fa-icon> <span>Cancel</span>
</button>
<button id="jhi-confirm-delete-hallImage" data-cy="entityConfirmDeleteButton" type="submit" class="btn btn-danger">
<fa-icon icon="times"></fa-icon> <span>Delete</span>
</button>
</div>
}
it is having problems with "if (hallImage) {" in the ...../hall-image/delete/hall-image-delete-dialog.component.html
this syntax is present only in the "image-delete-dialog" files. this seems like a leftover of some pre-processing (is not Angular code)
i did play with having the image first be "string" then "ImageBlob" then "string" again in the course of the project setup (in JDL). Perhaps it's somehow stuck? how do i "nuke" the whole project and rebuild without any cache?
EDIT: actually this syntax is all over my newly regenerated files using the jhipster entity Hall command...this is so confusing...
I'm getting this with issue on 8.1.0
@if (hallImage) {
Confirm delete operation
<button type="button" class="btn-close" data-dismiss="modal" aria-hidden="true" (click)="cancel()">×</button> </div> <div class="modal-body"> <jhi-alert-error></jhi-alert-error> <p id="jhi-delete-hallImage-heading">Are you sure you want to delete Hall Image {{ hallImage.id }}?</p> </div> <div class="modal-footer"> <button type="button" class="btn btn-secondary" data-dismiss="modal" (click)="cancel()"> <fa-icon icon="ban"></fa-icon> <span>Cancel</span> </button> <button id="jhi-confirm-delete-hallImage" data-cy="entityConfirmDeleteButton" type="submit" class="btn btn-danger"> <fa-icon icon="times"></fa-icon> <span>Delete</span> </button> </div>
} it is having problems with "if (hallImage) {" in the ...../hall-image/delete/hall-image-delete-dialog.component.html
this syntax is present only in the "image-delete-dialog" files. this seems like a leftover of some pre-processing (is not Angular code)
i did play with having the image first be "string" then "ImageBlob" then "string" again in the course of the project setup (in JDL). Perhaps it's somehow stuck? how do i "nuke" the whole project and rebuild without any cache?
EDIT: actually this syntax is all over my newly regenerated files using the jhipster entity Hall command...this is so confusing...
Yup, same thing happened to me. Updated a column in my JDL from required to not required and it changed the ngIf's
and ngFor's
in the entity folder to @if/@for
Overview of the issue
Generated an entity with the attached json and ran npm start and plenty of errors are displayed
Logs
Motivation for or Use Case
Application is not starting
Reproduce the error
Generate the entities and start the app
Related issues
JHipster Version(s)
8.0.0-rc.1 + JDK 21
JHipster configuration
If you have a JDL please wrap it in below structure
JDL definitions
-->
Entity configuration(s)
entityName.json
files generated in the.jhipster
directorySaison.json
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
Environment and Tools
openjdk version "21" 2023-09-19 LTS OpenJDK Runtime Environment Temurin-21+35 (build 21+35-LTS) OpenJDK 64-Bit Server VM Temurin-21+35 (build 21+35-LTS, mixed mode, sharing)
git version 2.30.0.windows.2
node: v18.17.1 npm: 9.8.0
'docker' command could not be found
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Browsers and Operating System
Windows