During the generation of entities (jhipster jdl jhipster-jdl.jdl) in a monolith angular application, the following error is happening in entity-client template:
``
An error occured while running jhipster:entity-client#writeClientFiles
Error running generator entities: ReferenceError: /home/edilsonmendes/.nvm/versions/node/v16.13.1/lib/nodemodules/generator-jhipster/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-form.service.ts.ejs:195
193| ...<%= entityInstance %>RawValue,
194| <% for (const field of fields.filter(field => field.id)) { _%>
fieldName is not defined
``
It seems that the expression <%= fieldName %> in line 195 of the file generator-jhipster/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-form.service.ts should be <%= field.fieldName %>. As workaround, changing this on node_modules manually works fine.
Motivation for or Use Case
Its not possible generating any entities with this error.
Reproduce the error
1) Generate a new monolith jhipster 7.9.0, command: Jhipster
2) Create a jdl file with any entity and run: jhispter jdl
Related issues
I have never seen this before jhipster v7.9.0
Suggest a Fix
Change expression <%= fieldName %> in line 195 of the file generator-jhipster/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-form.service.ts should be <%= field.fieldName %>
Overview of the issue
During the generation of entities (jhipster jdl jhipster-jdl.jdl) in a monolith angular application, the following error is happening in entity-client template:
`` An error occured while running jhipster:entity-client#writeClientFiles Error running generator entities: ReferenceError: /home/edilsonmendes/.nvm/versions/node/v16.13.1/lib/nodemodules/generator-jhipster/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-form.service.ts.ejs:195 193| ...<%= entityInstance %>RawValue, 194| <% for (const field of fields.filter(field => field.id)) { _%>
fieldName is not defined `` It seems that the expression <%= fieldName %> in line 195 of the file generator-jhipster/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-form.service.ts should be <%= field.fieldName %>. As workaround, changing this on node_modules manually works fine.
Motivation for or Use Case
Its not possible generating any entities with this error.
Reproduce the error
1) Generate a new monolith jhipster 7.9.0, command: Jhipster 2) Create a jdl file with any entity and run: jhispter jdl
Related issues
I have never seen this before jhipster v7.9.0
Suggest a Fix
Change expression <%= fieldName %> in line 195 of the file generator-jhipster/generators/entity-client/templates/angular/src/main/webapp/app/entities/update/entity-form.service.ts should be <%= field.fieldName %>
JHipster Version(s)
7.9.0
JHipster configuration
Welcome to JHipster v7.9.0
Welcome to the JHipster Information Sub-Generator
JHipster Version(s)
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Environment and Tools
openjdk version "11.0.15" 2022-04-19 OpenJDK Runtime Environment Temurin-11.0.15+10 (build 11.0.15+10) OpenJDK 64-Bit Server VM Temurin-11.0.15+10 (build 11.0.15+10, mixed mode)
git version 2.25.1
node: v16.13.1
npm: 8.1.2
Docker version 20.10.11, build dea9396
docker-compose version 1.29.1, build c34c88b2
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System
Ubuntu (on WSL Windows 10)