{"record":{"id":"c4bc526363b1a4a0","repo":"apify/crawlee","slug":"duplicate-load-signal-name-json-stringify-name","errorCode":null,"errorMessage":"Duplicate load signal name ${JSON.stringify(name)}: ${hint}","messagePattern":"Duplicate load signal name (.+?): (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/autoscaling/system_status.ts","lineNumber":176,"sourceCode":"    /**\n     * Signal names are the keys of the reported {@apilink SystemInfo}, so a duplicate would leave a status object that\n     * contradicts actual behavior: both signals are still evaluated (any overloaded one holds concurrency down), but\n     * only the last is reported.\n     */\n    private assertUniqueSignalNames(): void {\n        const seen = new Set<string>();\n\n        for (const { name } of this.#signals) {\n            if (!seen.has(name)) {\n                seen.add(name);\n                continue;\n            }\n\n            const hint = BUILTIN_SIGNAL_NAMES.has(name)\n                ? `it is the name of a built-in signal. To replace that signal, switch it off with \\`loadSignals: { ${BUILTIN_SIGNAL_OPTION_KEYS[name]}: false }\\` and keep your implementation in \\`loadSignals.custom\\`; to run yours alongside it, give it a different name.`\n                : 'two custom signals cannot share a name - rename one of them.';\n\n            throw new Error(`Duplicate load signal name ${JSON.stringify(name)}: ${hint}`);\n        }\n    }\n\n    /**\n     * Returns an {@apilink SystemInfo} object with the following structure:\n     *\n     * ```javascript\n     * {\n     *     isSystemIdle: Boolean,\n     *     memInfo: Object,\n     *     eventLoopInfo: Object,\n     *     cpuInfo: Object\n     * }\n     * ```\n     *\n     * Where the `isSystemIdle` property is set to `false` if the system\n     * has been overloaded in the last `options.currentHistorySecs` seconds,\n     * and `true` otherwise.","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/apify/crawlee/blob/dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c/packages/core/src/autoscaling/system_status.ts#L158-L194","documentation":"SystemStatus registers load signals by name and enforces uniqueness in its constructor. Passing two signals with the same name — or one shadowing a built-in signal's name — is ambiguous, so it throws with a hint explaining whether the clash is with a built-in or another custom signal.","triggerScenarios":"Passing two custom load signals with an identical `name` in `loadSignals.custom`; passing a custom signal whose name equals a built-in signal name (instead of disabling the built-in via `loadSignals: { <builtin>: false }`).","commonSituations":"Spreading an array of custom signals that contains duplicates; copying an example custom signal that reuses a built-in name; refactors merging two signal factories with the same default name.","solutions":["Rename one of the duplicate custom signals.","If the intent is to replace a built-in, disable it: `loadSignals: { <BUILTIN_KEY>: false }` and keep the implementation in `loadSignals.custom`.","Deduplicate the array of signals before constructing SystemStatus."],"exampleFix":"// before\nnew SystemStatus({ loadSignals: { custom: [{ name: 'cpu', ... }, { name: 'cpu', ... }] } });\n// after\nnew SystemStatus({ loadSignals: { custom: [{ name: 'cpu', ... }, { name: 'gpu', ... }] } });","handlingStrategy":"validation","validationCode":"const names = customSignals.map((s) => s.name);\nconst dupes = names.filter((n, i) => names.indexOf(n) !== i);\nif (dupes.length) throw new Error(`Duplicate signal names: ${dupes.join(', ')}`);","typeGuard":null,"tryCatchPattern":"try { const status = new SystemStatus({ loadSignals: { custom: signals } }); } catch (err) { if (err.message.includes('Duplicate load signal name')) { console.error(err.message); /* follow the hint: rename or disable the built-in */ } else { throw err; } }","preventionTips":["Keep custom signal names distinct from built-in signal names","Deduplicate signal arrays before constructing SystemStatus","Read the thrown hint: built-in clashes require disabling the built-in via loadSignals"],"tags":["autoscaling","system-status","configuration","core"],"backgroundTag":"duplicate-identifier","analyzedSha":"dbe57fb09ca607ad59dcf998f3925ef9ac3bb26c","analyzedAt":"2026-08-30T22:22:28.328Z","schemaVersion":2},"datasetVersion":"2026-08-30T23:17:21.991Z"}