版本:generator-jhipster 2.21.1 版本:jhipster-uml 1.6.5
当我尝试创建新实体时,我得到了' TypeError:无法读取属性'替换'未定义'
D:\Advanze\workspace2\sms>jhipster-uml entity_Vendor_Support.jh
Creating:
VendorSupport
VendorSupportReply
Found the .jhipster/VendorSupport.json configuration file, automatically generating the entity
The entity VendorSupport is being created.
events.js:160
throw er; // Unhandled 'error' event
^
TypeError: Cannot read property 'replace' of undefined
at EntityGenerator.files (C:\Users\manson\AppData\Roaming\npm\node_modules\generator-jhipster\entity\index.js:1190:49)
at C:\Users\manson\AppData\Roaming\npm\node_modules\generator-jhipster\node_modules\yeoman-generator\lib\base.js:429:16
at runCallback (timers.js:649:20)
at tryOnImmediate (timers.js:622:5)
at processImmediate [as _immediateCallback] (timers.js:594:5)
Found the .jhipster/VendorSupportReply.json configuration file, automatically generating the entity
The entity VendorSupportReply is being created.
events.js:160
throw er; // Unhandled 'error' event
^
TypeError: Cannot read property 'replace' of undefined
at EntityGenerator.files (C:\Users\manson\AppData\Roaming\npm\node_modules\generator-jhipster\entity\index.js:1190:49)
at C:\Users\manson\AppData\Roaming\npm\node_modules\generator-jhipster\node_modules\yeoman-generator\lib\base.js:429:16
at runCallback (timers.js:649:20)
at tryOnImmediate (timers.js:622:5)
at processImmediate [as _immediateCallback] (timers.js:594:5)
任何想法都会受到赞赏。提前谢谢!
entity VendorSupport{
title String required maxlength(255),
description String required maxlength(4096),
status String maxlength(20),
createdBy String required,
modifiedBy String required,
created ZonedDateTime required,
modified ZonedDateTime required
}
entity VendorSupportReply{
description String required maxlength(4096),
status String maxlength(20),
createdBy String required,
modifiedBy String required,
created ZonedDateTime required,
modified ZonedDateTime required
}
relationship ManyToOne {
VendorSupportReply{VendorSupport} to VendorSupport
}
jh文件
答案 0 :(得分:0)
您可能已经发现,生成器在this line
上失败了enumInfo.enums = enumInfo.enumValues.replace(/\s/g, '').split(',');
它似乎认为你的一个字段是枚举,你的JDL文件没有枚举,所以我的猜测是由于ZonedDateTime
字段类型而不是JHipster支持2.21.1。
因此,您要么更改此类型,要么将JHipster更新为更新版本。