n8n 'No testing function found for this credential' Fix
说明与用途
在 n8n 中,自定义节点的凭据测试因加载器错误而无法显示。解决方案:在凭据类中直接定义测试,删除 testedBy 和 credentialTest。重启 n8n 后,测试即可正常运行。
问题
Custom n8n nodes with credentials fail to show a test result, displaying "No testing function found for this credential."
结果
Custom credentials now test correctly without relying on node‑level credentialTest, simplifying maintenance and avoiding loader bugs.
工作流
- 1. Open the credential file (e.g., credentials/MyApi.credentials.ts).
- 2. Remove the testedBy property.
- 3. Add a test property of type ICredentialTestRequest with request details and validation rules.
- 4. Delete the credentialTest method from the node file (e.g., nodes/MyApi.node.ts).
- 5. Save changes and restart n8n.
- 6. In the n8n UI, open the credential and click Test – a green checkmark should appear if the API responds correctly.
- 7. (Optional) If you need shared test logic across nodes, package the node as a real npm module so n8n loads it as a community node, which resolves credentialTest correctly.
证据
The fix that survives across n8n versions is to stop relying on credentialTest on the node and instead define the test directly on the credential class as an ICredentialTestRequest.
For custom and community nodes the two keys never match, so the linkage is dropped and the UI shows the "no testing function" message.
- 记录日期: 2026-09-09T23:15:40.611Z