跳至主要內容
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?

4563博客

全新的繁體中文 WordPress 網站
  • 首頁
  • 有人使用小程序的云开发遇到过这个报错吗? cloud function service error code -501000, error message Environment not found
未分類
17 12 月 2020

有人使用小程序的云开发遇到过这个报错吗? cloud function service error code -501000, error message Environment not found

有人使用小程序的云开发遇到过这个报错吗? cloud function service error code -501000, error message Environment not found

資深大佬 : labulaka521 5

云函数已经上传了,云端测试也是正常的

const cloud = require('wx-server-sdk')  // 初始化 cloud cloud.init({   // API 调用都保持和云函数当前所在环境一致   env: cloud.DYNAMIC_CURRENT_ENV })  /**  * 这个示例将经自动鉴权过的小程序用户 openid 返回给小程序端  *  * event 参数包含小程序端调用传入的 data  *  */ exports.main = async (event, context) => {   console.log(context) }  

完整报错

Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail requestID , cloud function service error code -501000, error message Environment not found; at cloud.callFunction api;  

大佬有話說 (5)

  • 資深大佬 : xiaTianChiXiGua

    error message Environment not found 这不是写了错误提示了么,你把 env: cloud.DYNAMIC_CURRENT_ENV 这个改成 env:’你的环境 id’

  • 資深大佬 : bbsabc2

    云内容删掉,整体重新上传一遍就好了

  • 主 資深大佬 : labulaka521

    @bbsabc2 是把云函数删掉吗

  • 主 資深大佬 : labulaka521

    @bbsabc2 这个函数我开启本地调试就可以正常访问,然后关闭后就访问不了了,服了,有毒

  • 主 資深大佬 : labulaka521

    @xiaTianChiXiGua
    @bbsabc2
    谢谢 终于找到问题了 我换了小程序 但是没换 env 的环境 id 自已好蠢

文章導覽

上一篇文章
下一篇文章

AD

其他操作

  • 登入
  • 訂閱網站內容的資訊提供
  • 訂閱留言的資訊提供
  • WordPress.org 台灣繁體中文

51la

4563博客

全新的繁體中文 WordPress 網站
返回頂端
本站採用 WordPress 建置 | 佈景主題採用 GretaThemes 所設計的 Memory
4563博客
  • Hostloc 空間訪問刷分
  • 售賣場
  • 廣告位
  • 賣站?
在這裡新增小工具