{"record":{"id":"5261b8213bd91b10","repo":"remotion-dev/remotion","slug":"exposure-must-be-max-exposure-but-got-j","errorCode":null,"errorMessage":"\"exposure\" must be <= ${MAX_EXPOSURE}, but got ${JSON.stringify(resolved.exposure)}","messagePattern":"\"exposure\" must be <= (.+?), but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/color-correction.ts","lineNumber":175,"sourceCode":"\tassertOptionalFiniteNumber(params.pivot, 'pivot');\n\tassertOptionalFiniteNumber(params.shadows, 'shadows');\n\tassertOptionalFiniteNumber(params.highlights, 'highlights');\n\tassertOptionalFiniteNumber(params.whites, 'whites');\n\tassertOptionalFiniteNumber(params.blacks, 'blacks');\n\tassertOptionalFiniteNumber(params.temperature, 'temperature');\n\tassertOptionalFiniteNumber(params.tint, 'tint');\n\tassertOptionalFiniteNumber(params.saturation, 'saturation');\n\tassertOptionalFiniteNumber(params.vibrance, 'vibrance');\n\n\tconst resolved = resolve(params);\n\tif (resolved.exposure < MIN_EXPOSURE) {\n\t\tthrow new TypeError(\n\t\t\t`\"exposure\" must be >= ${MIN_EXPOSURE}, but got ${JSON.stringify(resolved.exposure)}`,\n\t\t);\n\t}\n\n\tif (resolved.exposure > MAX_EXPOSURE) {\n\t\tthrow new TypeError(\n\t\t\t`\"exposure\" must be <= ${MAX_EXPOSURE}, but got ${JSON.stringify(resolved.exposure)}`,\n\t\t);\n\t}\n\n\tvalidateNonNegative(resolved.contrast, 'contrast');\n\tvalidateUnitInterval(resolved.pivot, 'pivot');\n\tvalidateSignedUnitInterval(resolved.shadows, 'shadows');\n\tvalidateSignedUnitInterval(resolved.highlights, 'highlights');\n\tvalidateSignedUnitInterval(resolved.whites, 'whites');\n\tvalidateSignedUnitInterval(resolved.blacks, 'blacks');\n\tvalidateSignedUnitInterval(resolved.temperature, 'temperature');\n\tvalidateSignedUnitInterval(resolved.tint, 'tint');\n\tvalidateNonNegative(resolved.saturation, 'saturation');\n\tvalidateSignedUnitInterval(resolved.vibrance, 'vibrance');\n};\n\nconst VERTEX_SHADER = /* glsl */ `#version 300 es\nin vec2 aPos;","sourceCodeStart":157,"sourceCodeEnd":193,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/color-correction.ts#L157-L193","documentation":"Thrown by validateColorCorrectionParams when the resolved exposure value exceeds MAX_EXPOSURE (5). Exposure is in stops and the schema caps it at 5; anything above is rejected with a TypeError showing the offending value. This is a caller-input error.","triggerScenarios":"Calling colorCorrection({exposure: x}) where x > 5, evaluated at color-correction.ts:174 after the lower-bound check passes. Reached once exposure is confirmed finite and >= -5.","commonSituations":"Animated exposure from Spring/interpolate that overshoots above 5, a value ported from a different exposure scale, or a slider whose max exceeds 5.","solutions":["Clamp exposure to [-5, 5]: Math.max(-5, Math.min(5, value)).","Use interpolate(..., {extrapolateLeft: 'clamp', extrapolateRight: 'clamp'}) so animation cannot exceed the cap.","Inspect the value in the error message and fix the producer of that number.","Omit exposure to use the default of 0."],"exampleFix":"// before\ncolorCorrection({exposure: 8}); // throws: must be <= 5\n\n// after\nconst exposure = Math.max(-5, Math.min(5, springValue));\ncolorCorrection({exposure});","handlingStrategy":"validation","validationCode":"const EXPOSURE_MIN = -5;\nconst EXPOSURE_MAX = 5;\n\nfunction assertExposure(value: number | undefined): number | undefined {\n  if (value === undefined) return value;\n  if (!Number.isFinite(value)) {\n    throw new TypeError(`exposure must be finite, got ${value}`);\n  }\n  if (value < EXPOSURE_MIN || value > EXPOSURE_MAX) {\n    throw new TypeError(\n      `exposure must be in [${EXPOSURE_MIN}, ${EXPOSURE_MAX}], got ${value}`,\n    );\n  }\n  return value;\n}","typeGuard":"const isExposure = (v: unknown): v is number =>\n  typeof v === 'number' &&\n  Number.isFinite(v) &&\n  v >= -5 &&\n  v <= 5;","tryCatchPattern":null,"preventionTips":["Clamp animated exposure to [-5, 5] before passing it to colorCorrection().","Use interpolate with clamped extrapolation for any value driving exposure.","Keep the stops scale in mind; do not feed values from a 0-100 scale directly.","Omit exposure to use the default 0 when no adjustment is needed."],"tags":["color-correction","validation","typescript","params","exposure"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}