{"record":{"id":"0f66711017a53268","repo":"FlowiseAI/Flowise","slug":"error-componentscredentialscontroller-getsingleco","errorCode":null,"errorMessage":"Error: componentsCredentialsController.getSingleComponentsCredentialIcon - name not provided!","messagePattern":"Error: componentsCredentialsController\\.getSingleComponentsCredentialIcon - name not provided!","errorType":"exception","errorClass":"InternalFlowiseError","httpStatus":412,"severity":"error","filePath":"packages/server/src/controllers/components-credentials/index.ts","lineNumber":36,"sourceCode":"    try {\n        if (typeof req.params === 'undefined' || !req.params.name) {\n            throw new InternalFlowiseError(\n                StatusCodes.PRECONDITION_FAILED,\n                `Error: componentsCredentialsController.getComponentByName - name not provided!`\n            )\n        }\n        const apiResponse = await componentsCredentialsService.getComponentByName(req.params.name)\n        return res.json(apiResponse)\n    } catch (error) {\n        next(error)\n    }\n}\n\n// Returns specific component credential icon via name\nconst getSingleComponentsCredentialIcon = async (req: Request, res: Response, next: NextFunction) => {\n    try {\n        if (typeof req.params === 'undefined' || !req.params.name) {\n            throw new InternalFlowiseError(\n                StatusCodes.PRECONDITION_FAILED,\n                `Error: componentsCredentialsController.getSingleComponentsCredentialIcon - name not provided!`\n            )\n        }\n        const apiResponse = await componentsCredentialsService.getSingleComponentsCredentialIcon(req.params.name)\n        return res.sendFile(apiResponse)\n    } catch (error) {\n        next(error)\n    }\n}\n\nexport default {\n    getAllComponentsCredentials,\n    getComponentByName,\n    getSingleComponentsCredentialIcon\n}\n","sourceCodeStart":18,"sourceCodeEnd":53,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/server/src/controllers/components-credentials/index.ts#L18-L53","documentation":"Thrown by getSingleComponentsCredentialIcon when req.params.name is missing. The endpoint resolves and streams the icon file for a named component credential via res.sendFile. Without a name the service cannot locate the asset. Returned as PRECONDITION_FAILED (412).","triggerScenarios":"GET to the icon route without :name, or a route without :name declared so the param is undefined.","commonSituations":"Icon <img src> built from an unselected component, a migration that changed component names leaving stale icon URLs, or a typo'd path template.","solutions":["Provide the component-credential name in the path.","Render the icon element only when a name is known.","Confirm the route declares :name and that the static-asset resolution path exists."],"exampleFix":"// before\n<img src={`/api/v1/components-credentials/icon`} />\n// after\n<img src={`/api/v1/components-credentials/${encodeURIComponent(name)}/icon`} />","handlingStrategy":"validation","validationCode":"function getComponentIcon(name: string) {\n  if (!name) throw new Error('component name required for icon')\n  return fetch(`/api/v1/components-credentials/${encodeURIComponent(name)}/icon`)\n}","typeGuard":"const isNonEmptyString = (v: unknown): v is string => typeof v === 'string' && v.trim().length > 0","tryCatchPattern":"try { await getComponentIcon(name) } catch (e) { if (e.statusCode === 412) throw new Error('provide a component name') }","preventionTips":["Render icon elements only when a name is known.","Validate name presence client-side.","Confirm the route declares :name."],"tags":["flowise","controller","validation","precondition-failed","path-param","components","icon","typescript"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}