开发者社区 > 云原生 > Serverless > 正文

python代码执行s local invoke时出错 ERR_INVALID_ARG_TYPE

其他命令如s deploy, sync和层相关的操作都没有问题,但是执行s local invoke时,报以下错误:

1.10.3: Pulling from aliyunfc/runtime-python3.6 node:internal/streams/writable:315 throw new ERR_INVALID_ARG_TYPE( ^

TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be of type string or an instance of Buffer or Uint8Array. Received undefined at new NodeError (node:internal/errors:393:5) at _write (node:internal/streams/writable:315:13) at Writable.write (node:internal/streams/writable:337:10) at o (C:\Users\myusername.s\components\devsapp.cn\devsapp\fc-core\dist\index.js:223:27) at processLine (C:\Users\myusername.s\components\devsapp.cn\devsapp\fc-local-invoke\dist\index.js:57777:11) at pump (C:\Users\myusername.s\components\devsapp.cn\devsapp\fc-local-invoke\dist\index.js:57766:9) at IncomingMessage.onStreamEvent (C:\Users\myusername.s\components\devsapp.cn\devsapp\fc-local-invoke\dist\index.js:57757:5) at IncomingMessage.emit (node:events:513:28) at IncomingMessage.emit (node:domain:489:12) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) at Readable.push (node:internal/streams/readable:234:10) at HTTPParser.parserOnBody (node:_http_common:129:24) at Socket.socketOnData (node:_http_client:534:22) at Socket.emit (node:events:513:28) at Socket.emit (node:domain:489:12) at addChunk (node:internal/streams/readable:324:12) at readableAddChunk (node:internal/streams/readable:297:9) at Readable.push (node:internal/streams/readable:234:10) at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) { code: 'ERR_INVALID_ARG_TYPE' }

Node.js v18.12.1

想咨询下原因是什么 如何解决 谢谢!

展开
收起
n叶子 2023-01-20 17:30:42 444 0
2 条回答
写回答
取消 提交回答
  • 这是由于Python代码中的输出类型不正确导致的,可能是输出的类型不是字符串或Buffer或Uint8Array,请检查Python代码中的输出类型是否正确。

    2023-01-20 21:04:37
    赞同 展开评论 打赏
  • 天下风云出我辈,一入江湖岁月催,皇图霸业谈笑中,不胜人生一场醉。

    chunk”参数的类型必须为string或Buffer或Uint8Array的实例,chunk参数现在可以是Uint8Array实例。 参数 chunk||||要推入读取队列的数据块。

    2023-01-20 19:49:34
    赞同 展开评论 打赏
问答分类:
问答地址:

快速交付实现商业价值。

相关电子书

更多
From Python Scikit-Learn to Sc 立即下载
Data Pre-Processing in Python: 立即下载
双剑合璧-Python和大数据计算平台的结合 立即下载