冰雨1314
冰雨1314
  • 发布:2024-02-05 11:24
  • 更新:2024-02-26 10:03
  • 阅读:226

【报Bug】云函数,在本地可以正常运行,在云端运行失败

分类:uniCloud

产品分类: uniCloud/App

操作步骤:

在云端运行失败

预期结果:

可以正常运行

实际结果:

[html-pdf-co/ac1cc2f81707102501189151396/344976ms/ERROR] 云函数执行失败 Error: html-pdf: Unknown Error
/tmp/function/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: 1: /tmp/function/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: Syntax error: Unterminated quoted string

at ChildProcess.respond (/tmp/function/node_modules/html-pdf/lib/pdf.js:134:17)  
at emitTwo (events.js:126:13)  
at ChildProcess.emit (events.js:214:7)  
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)

bug描述:

requestId: ac1cc2f81707102501189151396

[html-pdf-co/ac1cc2f81707102501189151396/344976ms/ERROR] 云函数执行失败 Error: html-pdf: Unknown Error
/tmp/function/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: 1: /tmp/function/node_modules/phantomjs-prebuilt/lib/phantom/bin/phantomjs: Syntax error: Unterminated quoted string

at ChildProcess.respond (/tmp/function/node_modules/html-pdf/lib/pdf.js:134:17)  
at emitTwo (events.js:126:13)  
at ChildProcess.emit (events.js:214:7)  
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
2024-02-05 11:24 负责人:无 分享
已邀请:
DCloud_uniCloud_VK

DCloud_uniCloud_VK

云端的node版本和本地不一样导致的, 比如阿里云和腾讯云默认是node8, 支付宝默认是node18, 而本地是node16

冰雨1314

冰雨1314 (作者)

阿里云 也设置为 node16,本地也是 node 16, 貌似 phantomjs 在云上没有被正确安装

要回复问题请先登录注册