我正在使用JHipster构建一个微服务应用程序。
将网关从JHipster 4.13.3升级到4.14.1后,
在网关应用程序根目录中运行jhipster upgrade
,我得到了一些与实体CRUD控制器的错误URL相关的错误。
日志:
PhantomJS 2.1.1 (Linux 0.0.0) Service Tests Company Service Service methods should call correct URL FAILED
Expected 'undefinedordas/api/companies/123' to equal 'undefined/ordas/api/companies/123'.
webpack:///src/test/javascript/spec/app/entities/company/company.service.spec.ts:38:48 <- spec/entry.ts:118106:48
invoke@webpack:///node_modules/zone.js/dist/zone.js:388:0 <- spec/entry.ts:123093:31
onInvoke@webpack:///node_modules/zone.js/dist/proxy.js:79:0 <- spec/entry.ts:126599:45
invoke@webpack:///node_modules/zone.js/dist/zone.js:387:0 <- spec/entry.ts:123092:40
run@webpack:///node_modules/zone.js/dist/zone.js:138:0 <- spec/entry.ts:122843:49
webpack:///node_modules/zone.js/dist/jasmine-patch.js:106:0 <- spec/entry.ts:126760:37
execute@webpack:///node_modules/zone.js/dist/jasmine-patch.js:134:0 <- spec/entry.ts:126788:46
execute@webpack:///node_modules/zone.js/dist/jasmine-patch.js:134:0 <- spec/entry.ts:126788:46
execute@webpack:///node_modules/zone.js/dist/jasmine-patch.js:134:0 <- spec/entry.ts:126788:46
execute@webpack:///node_modules/zone.js/dist/jasmine-patch.js:134:0 <- spec/entry.ts:126788:46
invokeTask@webpack:///node_modules/zone.js/dist/zone.js:421:0 <- spec/entry.ts:123126:36
runTask@webpack:///node_modules/zone.js/dist/zone.js:188:0 <- spec/entry.ts:122893:57
drainMicroTaskQueue@webpack:///node_modules/zone.js/dist/zone.js:594:0 <- spec/entry.ts:123299:42
run@webpack:///node_modules/core-js/modules/es6.promise.js:87:0 <- spec/entry.ts:120862:29
webpack:///node_modules/core-js/modules/es6.promise.js:100:0 <- spec/entry.ts:120875:31
答案 0 :(得分:0)
生成的文件(related commit)发生了变化,从实体服务文件中的实体API网址中删除了/
。这样做是为了使实体服务使用相对路径而不是绝对路径。
虽然应该通过jhipster upgrade
子生成器自动更改它,但您也可以通过删除实体服务中的额外/
来手动修复它。
相关,您的SERVER_API_URL
中是否定义了webpack.common.js
变量?这似乎是“未定义的”。