{"record":{"id":"a158faa09c3cb827","repo":"pixijs/pixijs","slug":"uniform-type-uniformdata-type-is-not-supported","errorCode":null,"errorMessage":"Uniform type ${uniformData.type} is not supported. Use type: '${innerType}', size: ${size} instead.","messagePattern":"Uniform type (.+?) is not supported\\. Use type: '(.+?)', size: (.+?) instead\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/rendering/renderers/shared/shader/UniformGroup.ts","lineNumber":173,"sourceCode":"\n        const uniforms = {} as ExtractUniformObject<UNIFORMS>;\n\n        for (const i in uniformStructures)\n        {\n            const uniformData = uniformStructures[i] as UniformData;\n\n            uniformData.name = i;\n            uniformData.size = uniformData.size ?? 1;\n\n            if (!UNIFORM_TYPES_MAP[uniformData.type])\n            {\n                const arrayMatch = uniformData.type.match(/^array<(\\w+(?:<\\w+>)?),\\s*(\\d+)>$/);\n\n                if (arrayMatch)\n                {\n                    const [, innerType, size] = arrayMatch;\n\n                    throw new Error(\n                        `Uniform type ${uniformData.type} is not supported. Use type: '${innerType}', size: ${size} instead.`\n                    );\n                }\n\n                // eslint-disable-next-line max-len\n                throw new Error(`Uniform type ${uniformData.type} is not supported. Supported uniform types are: ${UNIFORM_TYPES_VALUES.join(', ')}`);\n            }\n\n            uniformData.value ??= getDefaultUniformValue(uniformData.type, uniformData.size);\n\n            uniforms[i] = uniformData.value as ExtractUniformObject<UNIFORMS>[keyof UNIFORMS];\n        }\n\n        this.uniforms = uniforms;\n\n        this._dirtyId = 1;\n        this.ubo = options.ubo;\n        this.isStatic = options.isStatic;","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/pixijs/pixijs/blob/4b141e3ced7255b39c2114b6bca03421a37b2363/src/rendering/renderers/shared/shader/UniformGroup.ts#L155-L191","documentation":"Thrown by UniformGroup when a uniform's `type` is the array shorthand `array<T, N>` (matched by regex) and is not in UNIFORM_TYPES_MAP. PixiJS does not parse the array<> syntax directly; arrays must be expressed as the inner scalar/vector type plus a `size` field.","triggerScenarios":"Defining a uniform with `{ type: 'array<f32, 4>' }` (or `array<vec3<f32>, 2>`) in a UniformGroup's uniformStructures. The regex captures the inner type and size to give a helpful, specific message.","commonSituations":"Copying WGSL/GLSL array syntax into a uniform structure definition; reading docs that show array uniforms and assuming the type string is accepted verbatim; migrating from a shader playground.","solutions":["Rewrite the uniform as `{ type: '<innerType>', size: <N> }` using the innerType and size surfaced in the error.","For nested array vectors, flatten or use the supported innerType with the matching size.","Confirm the chosen innerType is itself a supported UNIFORM_TYPES_MAP entry."],"exampleFix":"// before\nnew UniformGroup({ lights: { type: 'array<f32, 4>' } });\n// after\nnew UniformGroup({ lights: { type: 'f32', size: 4 } });","handlingStrategy":"validation","validationCode":"const ARRAY_RE = /^array<(\\w+(?:<\\w+>)?),\\s*(\\d+)>$/;\nfunction normalizeUniformType(def) {\n  const m = def.type.match(ARRAY_RE);\n  if (m) return { type: m[1], size: Number(m[2]) };\n  return def;\n}","typeGuard":"function isSupportedArrayType(t: string): boolean {\n  const m = t.match(/^array<(\\w+(?:<\\w+>)?),\\s*(\\d+)>$/);\n  return !!m;\n}","tryCatchPattern":null,"preventionTips":["Express arrays as { type: innerType, size: N } rather than the array<> shorthand.","Run uniform definitions through a normalizer before UniformGroup construction."],"tags":["uniforms","shader","configuration","array"],"backgroundTag":null,"analyzedSha":"4b141e3ced7255b39c2114b6bca03421a37b2363","analyzedAt":"2026-08-12T17:27:29.507Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}