{"record":{"id":"c05eb7efad428f54","repo":"remotion-dev/remotion","slug":"the-label-parameter-of-delayrender-must-be-a-str","errorCode":null,"errorMessage":"The label parameter of delayRender() must be a string or undefined, got: ${JSON.stringify(label)}","messagePattern":"The label parameter of delayRender\\(\\) must be a string or undefined, got: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/core/src/delay-render.ts","lineNumber":67,"sourceCode":" * Internal function that accepts environment as parameter.\n * This allows useDelayRender to control its own environment source.\n * @private\n */\ntype DelayRenderInternalOptions = {\n\tscope: DelayRenderScope;\n\tenvironment: RemotionEnvironment;\n\tlabel: string | null;\n\toptions: DelayRenderOptions;\n};\n\nexport const delayRenderInternal = ({\n\tscope,\n\tenvironment,\n\tlabel,\n\toptions,\n}: DelayRenderInternalOptions): number => {\n\tif (typeof label !== 'string' && label !== null) {\n\t\tthrow new Error(\n\t\t\t'The label parameter of delayRender() must be a string or undefined, got: ' +\n\t\t\t\tJSON.stringify(label),\n\t\t);\n\t}\n\n\tconst handle = Math.random();\n\tscope.remotion_delayRenderHandles.push(handle);\n\tconst called = Error().stack?.replace(/^Error/g, '') ?? '';\n\n\tif (environment.isRendering) {\n\t\tconst timeoutToUse =\n\t\t\t(options?.timeoutInMilliseconds ??\n\t\t\t\tscope.remotion_puppeteerTimeout ??\n\t\t\t\tdefaultTimeout) - 2000;\n\t\tconst retriesLeft = (options?.retries ?? 0) - (scope.remotion_attempt - 1);\n\t\tscope.remotion_delayRenderTimeouts[handle] = {\n\t\t\tlabel: label ?? null,\n\t\t\tstartTime: Date.now(),","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/core/src/delay-render.ts#L49-L85","documentation":"delayRender() takes an optional label used in timeout/diagnostic messages. The label must be a string (or omitted/undefined, which becomes null internally). Passing any other type (number, object, array) is rejected because the label is interpolated into log/timeout strings and non-string values would produce useless diagnostics.","triggerScenarios":"Calling delayRender(123), delayRender({name: 'load'}), delayRender(someObject), or delayRender(`${n}`) where the template accidentally yields a non-string. Also triggered by passing a config object where a label string was expected.","commonSituations":"Misreading the signature and passing an options object as the first arg; passing a numeric id instead of a descriptive label; variable that is sometimes undefined-typed but actually holds a non-string.","solutions":["Pass a string label or omit it: delayRender('loading data') or delayRender().","Move options into the second argument: delayRender('label', {timeoutInMilliseconds: 10000}).","Coerce safely: delayRender(String(label)) only if you genuinely mean it."],"exampleFix":"// before\ndelayRender({timeoutInMilliseconds: 10000})\n\n// after\ndelayRender('loading data', {timeoutInMilliseconds: 10000})","handlingStrategy":"validation","validationCode":"const safeLabel =\n  label === undefined || typeof label === 'string' ? label : String(label);\nconst handle = delayRender(safeLabel, options);","typeGuard":"const isValidDelayRenderLabel = (\n  label: unknown,\n): label is string | undefined =>\n  label === undefined || typeof label === 'string';","tryCatchPattern":null,"preventionTips":["Always pass a string label (or omit it) as the first argument.","Pass options only as the second argument.","Enable strict TypeScript checks on delayRender call sites."],"tags":["rendering","validation","delay-render","typescript"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}