{"record":{"id":"3e45228b8b38b144","repo":"remotion-dev/remotion","slug":"name-must-be-an-integer-but-got-json-strin-3e4522","errorCode":null,"errorMessage":"\"${name}\" must be an integer, but got ${JSON.stringify(value)}","messagePattern":"\"(.+?)\" must be an integer, but got (.+?)","errorType":"validation","errorClass":"TypeError","httpStatus":null,"severity":"error","filePath":"packages/effects/src/pixel-dissolve.ts","lineNumber":93,"sourceCode":"\treadonly seed: number;\n\treadonly feather: number;\n};\n\nconst resolve = (params: PixelDissolveParams): PixelDissolveResolved => ({\n\tprogress: params.progress ?? DEFAULT_PROGRESS,\n\tcolumns: params.columns ?? DEFAULT_COLUMNS,\n\trows: params.rows ?? DEFAULT_ROWS,\n\tseed: params.seed ?? DEFAULT_SEED,\n\tfeather: params.feather ?? DEFAULT_FEATHER,\n});\n\nconst assertOptionalIntegerNumber = (value: unknown, name: string): void => {\n\tif (value === undefined) {\n\t\treturn;\n\t}\n\n\tif (!Number.isInteger(value)) {\n\t\tthrow new TypeError(\n\t\t\t`\"${name}\" must be an integer, but got ${JSON.stringify(value)}`,\n\t\t);\n\t}\n};\n\nconst validatePixelDissolveParams = (params: PixelDissolveParams): void => {\n\tassertEffectParamsObject(params, 'Pixel Dissolve');\n\tassertOptionalFiniteNumber(params.progress, 'progress');\n\tassertOptionalFiniteNumber(params.columns, 'columns');\n\tassertOptionalFiniteNumber(params.rows, 'rows');\n\tassertOptionalFiniteNumber(params.seed, 'seed');\n\tassertOptionalFiniteNumber(params.feather, 'feather');\n\tassertOptionalIntegerNumber(params.columns, 'columns');\n\tassertOptionalIntegerNumber(params.rows, 'rows');\n\n\tconst r = resolve(params);\n\tvalidateUnitInterval(r.progress, 'progress');\n\tvalidateUnitInterval(r.feather, 'feather');","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/remotion-dev/remotion/blob/78fe4bb3fdb5a2cd68724393d63cb223db333fa7/packages/effects/src/pixel-dissolve.ts#L75-L111","documentation":"pixelDissolve() requires 'columns' and 'rows' to be integers (the grid divides the image into discrete cells). assertOptionalIntegerNumber throws a TypeError when either is supplied as a non-integer (fraction or non-number) before any GPU work runs.","triggerScenarios":"Calling pixelDissolve({ columns: 10.5 }) or pixelDissolve({ rows: '8' }) or pixelDissolve({ columns: NaN }). Validation runs in validatePixelDissolveParams during effect setup.","commonSituations":"Animating columns/rows from a slider that yields fractions; passing stringified numbers from config/URL; computing grid counts from a ratio without rounding.","solutions":["Round the value before passing: Math.round(x).","Keep columns/rows as whole numbers within the documented 1..400 range.","Coerce untyped inputs with Number() then check Number.isInteger yourself first."],"exampleFix":"// before\npixelDissolve({ columns: animatedCols }) // animatedCols = 10.5\n\n// after\npixelDissolve({ columns: Math.round(animatedCols) })","handlingStrategy":"validation","validationCode":"// Validate integer grid props before calling pixelDissolve().\nfunction asInt(v: unknown, name: string): number | undefined {\n  if (v === undefined) return undefined;\n  const n = Number(v);\n  if (!Number.isInteger(n)) throw new Error(`${name} must be an integer`);\n  return n;\n}\npixelDissolve({\n  columns: asInt(raw.columns, 'columns'),\n  rows: asInt(raw.rows, 'rows'),\n});","typeGuard":"const isOptionalInteger = (v: unknown): v is number =>\n  v === undefined || (typeof v === 'number' && Number.isInteger(v));","tryCatchPattern":null,"preventionTips":["Round slider/animation outputs with Math.round before passing to columns/rows.","Keep a typed config schema that rejects fractional values at the boundary.","Route string inputs through Number() and an integer check before pixelDissolve().","Keep columns/rows within the documented 1..400 range."],"tags":["validation","typescript","pixel-dissolve","integer","params"],"backgroundTag":null,"analyzedSha":"78fe4bb3fdb5a2cd68724393d63cb223db333fa7","analyzedAt":"2026-08-12T17:18:50.444Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}