APIs Custom Code and Third-party Libraries Support
By default, custom code for APIs does not support importing third-party libraries. The custom code includes built-in standard Node.js libraries as well as node-fetch, request, @cloudbase/node-sdk, and their related dependency libraries. These built-in libraries can be referenced via require and used in the code.
Cause of Error in Cloud Function: errMsg: urlscheme.generate:fail env status is isolated
The complete error message is as follows16 Uncaught (in promise) Error -1 | errMsgfail Error -504002 functions execute fail | errMsg errCode urlscheme.generate https://tcb.cloud.tencent.com/cloud-admin#/copilot?q=INVALID_ENV
Cloud Function and Other Online Development Features Unavailable
Cause of the Issue
Cloud Function Runtime Node.js16 ETIMEDOUT Issue
In the Cloud Functions runtime, the operational mechanism of the Node.jsV16 version has been modified, which may lead to ETIMEDOUT issues.
Dependency package not found when debugging cloud function in Cloud Editor
When using Cloud Editor to debug cloud functions, if a dependency package is reported as missing (e.g., wx-server-sdk not found), proceed as follows:
How to Set Global Environment Variables for Cloud Functions
Answer: Cloud functions do not have global environment variable settings; each function's environment variables are independent.
Why does invoking other cloud functions in cloud functions report a socket timeout error, but the invoked cloud function actually executed successfully and returned data?
You can set the timeout duration for cloud functions in the Function Configuration - Basic Information section on the page.
WxCloudSDKError: [Error] secret id error
When locally debugging cloud functions in WeChat Developer Tools, you may encounter the error message WxCloudSDKError: [Error] secret id error. This error is usually caused by the local debugging environment failing to correctly verify secretId.