淡绿色的小鬼
淡绿色的小鬼
  • 发布:2022-04-27 00:16
  • 更新:2022-04-27 17:21
  • 阅读:479

【报Bug】uniCloud.httpclient.request代理报ENOENT: no such file or directory, open '/code/bridge.js'

分类:uniCloud

产品分类: uniCloud/App

示例代码:
Error: ENOENT: no such file or directory, open '/code/bridge.js'  
    at openSync (fs.js:462:3)  
    at readFileSync (fs.js:364:35)  
    at (/code/index.js:45:84942)  
    at r (/code/index.js:1:124)  
    at (/code/index.js:227:321872)  
    at r (/code/index.js:1:124)  
    at (/code/index.js:227:321786)  
    at r (/code/index.js:1:124)  
    at (/code/index.js:227:92717)  
    at r (/code/index.js:1:124)  

操作步骤:
const res = await uniCloud.httpclient.request(`${this.baseURL}${url}`, {  
            method,  
            // data: {  
            //   test: 'testValue'  
            // },  
            headers: {  
                'Content-Type': 'application/json',  
                'X-MBX-APIKEY': this.apiKey,  
                // 'User-Agent': `${constants.appName}/${constants.appVersion}`  
            },  
            contentType: 'json', // 指定以application/json发送data内的数据  
            dataType: 'json', // 指定返回值为json格式,自动进行parse  
            timeout: this.timeout,  
            enableProxy: this.proxy ? true : false,  
            proxy: this.proxy ? this.proxy : ""  
        })

预期结果:

获取到请求结果

实际结果:
Error: ENOENT: no such file or directory, open '/code/bridge.js'  
    at openSync (fs.js:462:3)  
    at readFileSync (fs.js:364:35)  
    at (/code/index.js:45:84942)  
    at r (/code/index.js:1:124)  
    at (/code/index.js:227:321872)  
    at r (/code/index.js:1:124)  
    at (/code/index.js:227:321786)  
    at r (/code/index.js:1:124)  
    at (/code/index.js:227:92717)  
    at r (/code/index.js:1:124)  

bug描述:

代理功能在本地测试正常,上传到服务器报这个错误

2022-04-27 00:16 负责人:DCloud_uniCloud_WYQ 分享
已邀请:
DCloud_uniCloud_WYQ

DCloud_uniCloud_WYQ

此问题已反馈阿里云处理

  • jiangrenjin

    我今天也遇到了这个问题,,还没解决呀

    2022-08-21 18:06

该问题目前已经被锁定, 无法添加新回复