You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that there is a regression in latest version of JHipster (7.7.0): If the other side of a OneToOne relationship is embedded, the generation fails with the following error:
Error running generator app: TypeError: Cannot read properties of undefined (reading 'name')
TypeError: Cannot read properties of undefined (reading 'name')
at /Users/tayebchlyah/Projects/jhipster/projects/generator-jhipster/generators/entity/index.js:860:78
at Array.forEach (<anonymous>)
at EntityGenerator.processEagerLoadRelationships (/Users/tayebchlyah/Projects/jhipster/projects/generator-jhipster/generators/entity/index.js:853:36)
at Object.<anonymous> (/Users/tayebchlyah/Projects/jhipster/projects/generator-jhipster/node_modules/yeoman-generator/lib/index.js:1097:23)
at /Users/tayebchlyah/Projects/jhipster/projects/generator-jhipster/node_modules/run-async/index.js:49:25
at new Promise (<anonymous>)
at /Users/tayebchlyah/Projects/jhipster/projects/generator-jhipster/node_modules/run-async/index.js:26:19
at /Users/tayebchlyah/Projects/jhipster/projects/generator-jhipster/node_modules/yeoman-generator/lib/index.js:1098:9
at new Promise (<anonymous>)
at EntityGenerator.executeTask (/Users/tayebchlyah/Projects/jhipster/projects/generator-jhipster/node_modules/yeoman-generator/lib/index.js:1069:12)
at runLoop.add.once (/Users/tayebchlyah/Projects/jhipster/projects/generator-jhipster/node_modules/yeoman-generator/lib/index.js:1049:14)
at Immediate.<anonymous> (/Users/tayebchlyah/Projects/jhipster/projects/generator-jhipster/node_modules/grouped-queue/lib/subqueue.js:48:34)
at processImmediate (node:internal/timers:466:21)
Reproduce the error
Use the JDL below.
Suggest a Fix
A simple fix is to add a check relationship.otherEntity.primaryKey != null to
But since this code didn't change on version 7.7.0 (there was some updates after in the main branche but the issue is the same), I think it is coming from an other change that I couldn't find.
JHipster Version(s)
7.7.0
JHipster configuration
JDL definitions
entity Entity1 {}
@embedded
entity Entity2 {}
relationship OneToOne {
Entity1 to Entity2
}
The text was updated successfully, but these errors were encountered:
I confirm. I prefer testing embedded instead of primaryKey.
As workaround add @EagerLoad annotation to the relationship, it should not change anything using couchbase.
Overview of the issue
It seems that there is a regression in latest version of JHipster (7.7.0): If the other side of a OneToOne relationship is embedded, the generation fails with the following error:
Reproduce the error
Use the JDL below.
Suggest a Fix
A simple fix is to add a check
relationship.otherEntity.primaryKey != null
togenerator-jhipster/generators/entity/index.js
Line 860 in b3fca5e
But since this code didn't change on version 7.7.0 (there was some updates after in the main branche but the issue is the same), I think it is coming from an other change that I couldn't find.
JHipster Version(s)
7.7.0
JHipster configuration
JDL definitions
The text was updated successfully, but these errors were encountered: