[Bug Report] @midwayjs/mock 包创建 App 的BUG #4241
billy-poon
started this conversation in
General / 闲聊
Replies: 1 comment
-
用 bootstrap.js 不需要走 @midwayjs/mock,mock 里是给单测用的。
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
用 mwtsc + @midwayjs/mock 启动开发环境时,如果指定了
entryFile
,如在 @midway/mock 包的 creator.js 文件
create
函数一旦检测到entryFile
选项就会加载对应的文件,然后return (undefined);
:midway/packages/mock/src/creator.ts
Line 121 in 7f84d85
此后在 同一个文件中的
createApp
函数并没有对这个返回值进行判断,会导致framework.getApplication()
报undefined
:midway/packages/mock/src/creator.ts
Line 266 in 7f84d85
然后后续的热重载似乎也需要用到这个返回值,才能正确
close
。目前我的临时解决方案是修改安装后的 creator.js 的
createApp
函数Beta Was this translation helpful? Give feedback.
All reactions