{"record":{"id":"49f9f5d2c5c2a52b","repo":"remotion-dev/remotion","slug":"failed-to-render-gif-with-source-src-error-49f9f5","errorCode":null,"errorMessage":"Failed to render GIF with source ${src}: \"${error.message}\". Render with --log=verbose to see the full stack.","messagePattern":"Failed to render GIF with source (.+?): \"(.+?)\"\\. Render with --log=verbose to see the full stack\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/gif/src/GifForRendering.tsx","lineNumber":156,"sourceCode":"\t\t}, [\n\t\t\trenderHandle,\n\t\t\tlogLevel,\n\t\t\tcacheKey,\n\t\t\tresolvedSrc,\n\t\t\tdelayRender,\n\t\t\tcontinueRender,\n\t\t\tdelayRenderTimeoutInMilliseconds,\n\t\t]);\n\n\t\tif (error) {\n\t\t\tInternals.Log.error({logLevel, tag: null}, error.stack);\n\t\t\tif (isCorsError(error)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`Failed to render GIF with source ${src}: \"${error.message}\". You must enable CORS for this URL.`,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tthrow new Error(\n\t\t\t\t`Failed to render GIF with source ${src}: \"${error.message}\". Render with --log=verbose to see the full stack.`,\n\t\t\t);\n\t\t}\n\n\t\tif (index === -1) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<Canvas\n\t\t\t\tfit={fit}\n\t\t\t\tindex={index}\n\t\t\t\tframes={state.frames}\n\t\t\t\twidth={width}\n\t\t\t\theight={height}\n\t\t\t\teffects={effects}\n\t\t\t\t{...props}\n\t\t\t\tref={ref}","sourceCodeStart":138,"sourceCodeEnd":174,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/gif/src/GifForRendering.tsx#L138-L174","documentation":"Thrown by GifForRendering during a server-side render when the GIF fetch/decode failed for a non-CORS reason. The message directs the user to re-run with `--log=verbose` because, unlike the Studio path, the full stack is only emitted through `Internals.Log` at verbose level rather than always to stderr.","triggerScenarios":"`remotion render` of a composition with a `<Gif>` whose `src` returns 404/5xx, is unreachable from the render machine, or returns bytes that are not a valid GIF. Distinguished from 1042 only by the absence of a CORS signature on the error.","commonSituations":"The render machine (CI runner or Lambda) has no internet egress or the host is blocked; the asset URL is environment-specific and wrong in the render environment; a partially uploaded/corrupt GIF file on the origin; DNS resolution failure for the asset host.","solutions":["Re-run the render with `--log=verbose` (or set `Config.setLogLevel('verbose')`) to see the original error stack.","Confirm the render environment can reach the URL (curl it from the CI/Lambda context).","Validate the GIF file is well-formed by opening it locally.","Switch the asset to `staticFile()` to remove the network dependency from the render."],"exampleFix":"# before\nnpx remotion render MyComp out/video.mp4\n\n# after\nnpx remotion render MyComp out/video.mp4 --log=verbose","handlingStrategy":"validation","validationCode":"// Smoke-test asset reachability from the render environment before rendering.\nconst ok = await fetch(gifUrl, {method: 'HEAD'}).then((r) => r.ok).catch(() => false);\nif (!ok) throw new Error(`GIF unreachable from render env: ${gifUrl}`);","typeGuard":null,"tryCatchPattern":"// In render code there is no UI; surface the failure with maximum context.\ntry {\n  await renderMediaOnLambda({...});\n} catch (err) {\n  if (/Failed to render GIF/.test(String(err))) {\n    throw new Error(`GIF render failed for ${gifUrl}. Re-run with --log=verbose. Cause: ${err}`);\n  }\n  throw err;\n}","preventionTips":["Always render with `--log=verbose` when debugging GIF failures so the underlying stack is printed.","Confirm CI/Lambda can reach the asset host (network egress, DNS) before rendering.","Prefer staticFile() or bundled imports for assets used in renders."],"tags":["gif","render","network","fetch"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}