云函数调用失败: Error: cloud.callFunction:fail Error: errCode: -501000 | errMsg: [100003] env not exists (73110277-3109-410e-8666-6b0a8798fd76) 请前往云开发AI小助手查看问题:https://tcb.cloud.tencent.com/cloud-admin#/copilot?q=INVALID_ENV (callId: 1734083041970-0.06901280321070802) (trace: 17:44:1 start->17:44:2 system error (Error: errCode: -501000 | errMsg: [100003] env not exists (73110277-3109-410e-8666-6b0a8798fd76) 请前往云开发AI小助手查看问题:https://tcb.cloud.tencent.com/cloud-admin#/copilot?q=INVALID_ENV), abort)
at O (<anonymous>:1:249136)
at <anonymous>:1:285173(env: Windows,mp,1.06.2409140; lib: 3.7.0)
app.js里有env id
wx.cloud.init({
env: "xx",
traceUser: true,
});
云函数里也有:
// 修改初始化方式,明确指定环境ID
cloud.init({
env: cloud.DYNAMIC_CURRENT_ENV
})

我都按照文档写了,报错
const cloud = require('wx-server-sdk')
const CONFIG_COLLECTION = 'app_config'
exports.main = async (event, context) => {
try {
// 声明新的 cloud 实例,指向资源方环境
const c1 = new cloud.Cloud({
// 资源方 AppID
resourceAppid: '********',
// 资源方环境 ID
resourceEnv: '**********',
})
// 初始化资源方环境
await c1.init()
// 关键修正:使用新实例的数据库对象
const res = await c1.database().collection(CONFIG_COLLECTION).get()
console.log(' ---> B数据库res:', res);
return {
success: true,
data: res.data
}
} catch (err) {
console.log(' ---> 错误err:', err);
return {
success: false,
message: err.message,
stack: err.stack, // 错误堆栈,便于定位哪一行出错
name: err.name // 错误类型(如权限错误、初始化错误等)
}
}
}
小程序A也环境共享给B了
小程序A云函数中也创建了cloudbase_auth云函数,
为啥B中调用B中创建的云函数获取A中的数据库报错了、还是说没有缺少什么?有大神可以帮忙看看吗