pixijs/pixijs · error · Error
Uniform type ${uniformData.type} is not supported. Use type:
Error message
Uniform type ${uniformData.type} is not supported. Use type: '${innerType}', size: ${size} instead. What it means
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.
Source
Thrown at src/rendering/renderers/shared/shader/UniformGroup.ts:173
const uniforms = {} as ExtractUniformObject<UNIFORMS>;
for (const i in uniformStructures)
{
const uniformData = uniformStructures[i] as UniformData;
uniformData.name = i;
uniformData.size = uniformData.size ?? 1;
if (!UNIFORM_TYPES_MAP[uniformData.type])
{
const arrayMatch = uniformData.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);
if (arrayMatch)
{
const [, innerType, size] = arrayMatch;
throw new Error(
`Uniform type ${uniformData.type} is not supported. Use type: '${innerType}', size: ${size} instead.`
);
}
// eslint-disable-next-line max-len
throw new Error(`Uniform type ${uniformData.type} is not supported. Supported uniform types are: ${UNIFORM_TYPES_VALUES.join(', ')}`);
}
uniformData.value ??= getDefaultUniformValue(uniformData.type, uniformData.size);
uniforms[i] = uniformData.value as ExtractUniformObject<UNIFORMS>[keyof UNIFORMS];
}
this.uniforms = uniforms;
this._dirtyId = 1;
this.ubo = options.ubo;
this.isStatic = options.isStatic;View on GitHub (pinned to 4b141e3ced)
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.
Example fix
// before
new UniformGroup({ lights: { type: 'array<f32, 4>' } });
// after
new UniformGroup({ lights: { type: 'f32', size: 4 } }); Defensive patterns
Strategy: validation
Validate before calling
const ARRAY_RE = /^array<(\w+(?:<\w+>)?),\s*(\d+)>$/;
function normalizeUniformType(def) {
const m = def.type.match(ARRAY_RE);
if (m) return { type: m[1], size: Number(m[2]) };
return def;
} Type guard
function isSupportedArrayType(t: string): boolean {
const m = t.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);
return !!m;
} Prevention
- Express arrays as { type: innerType, size: N } rather than the array<> shorthand.
- Run uniform definitions through a normalizer before UniformGroup construction.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Uniform type ${uniformData.type} is not supported. Supported
- [Shader] Cannot have both resources and groups
- [Shader] No group map or WebGPU shader provided - consider u
- [Resolver] GenerateBundleAssetId are not working correctly
- [Resolver] alias is undefined for this asset: ${formattedAss
AI-assisted analysis of pixijs/pixijs@4b141e3ced (2026-08-12).
Data as JSON: /api/errors/a158faa09c3cb827.
Report an issue: GitHub.