云函数偶尔报FormData is not defined,是不是执行环境不一致?
发布于 6 年前 作者 ykong 1693 次浏览 来自 官方Issues

我在云函数里有这么一行代码:

var formData = new FormData()

然后发现云函数执行日志有时候是成功的,有时候报FormData is not defined,怀疑是云函数的执行环境不一致,有的环境有FormData,有的环境没有,希望官方能排查一下。

成功时的日志:

START RequestId: 1417ebf2-f6d3-11e9-9b52-525400b2c41b

Event RequestId: 1417ebf2-f6d3-11e9-9b52-525400b2c41b


2019-10-25T02:56:44.926Z  { errMsg: 'openapi.security.msgSecCheck:ok', errCode: 0 }



END RequestId: 1417ebf2-f6d3-11e9-9b52-525400b2c41b

Report RequestId: 1417ebf2-f6d3-11e9-9b52-525400b2c41b Duration:200ms Memory:256MB MaxMemoryUsed:26.910156MB

失败时的日志:

START RequestId: 8eadf495-f6d3-11e9-baa4-525400dee61a

Event RequestId: 8eadf495-f6d3-11e9-baa4-525400dee61a


2019-10-25T03:00:10.385Z  ReferenceError: FormData is not defined

at EventHandler.exports.main [as realHandler] (/var/user/index.js:68:22)

at EventHandler.handle (/var/runtime/node8/bootstrap.js:401:28)

at invoke (/var/runtime/node8/bootstrap.js:204:22)

at Timeout.setTimeout [as _onTimeout] (/var/runtime/node8/bootstrap.js:133:9)

at ontimeout (timers.js:475:11)

at tryOnTimeout (timers.js:310:5)

at Timer.listOnTimeout (timers.js:270:5)



END RequestId: 8eadf495-f6d3-11e9-baa4-525400dee61a

Report RequestId: 8eadf495-f6d3-11e9-baa4-525400dee61a Duration:0ms Memory:256MB MaxMemoryUsed:26.871094MB

回到顶部