xwj-vic / yapi

Apache License 2.0
76 stars 17 forks source link

Method Promise.prototype.then called on incompatible receiver [object Object] #10

Closed killlowkey closed 1 year ago

killlowkey commented 1 year ago

版本号

xuweijie1015/yapi:latest

什么问题

使用接口中的高级 Mock 脚本方式进行 mock,会出现 Method Promise.prototype.then called on incompatible receiver [object Object]。 堆栈信息如下所示

Error: Error: Method Promise.prototype.then called on incompatible receiver [object Object]
at Safeify.handleScriptResult (/yapi/vendors/node_modules/safeify/lib/Safeify.js:189:34)
at Safeify.handleScriptDone (/yapi/vendors/node_modules/safeify/lib/Safeify.js:178:14)
at Safeify.onWorkerDone (/yapi/vendors/node_modules/safeify/lib/Safeify.js:164:14)
at ChildProcess.Safeify.onWorkerMessage (/yapi/vendors/node_modules/safeify/lib/Safeify.js:55:33)
at ChildProcess.emit (events.js:310:20)
at emit (internal/child_process.js:876:12)
at processTicksAndRejections (internal/process/task_queues.js:85:21)

如何复现此问题

接口信息 image

mock 脚本 image

运行结果 image

什么浏览器

chrome

什么系统(Linux, Windows, macOS)

windows

xwj-vic commented 1 year ago

好的,我排查一下

xwj-vic commented 1 year ago

已解决,请拉最新镜像

killlowkey commented 1 year ago

已解决,请拉最新镜像

感谢,拉取后能正常使用