phaserjs/phaser · error · Error
Particle has no texture frame
Error message
Particle has no texture frame
What it means
Particle.js:462 throws when `this.frame` is falsy after the emit logic. The frame comes from `emitter.getFrame()` (ParticleEmitter.js:1265) which picks from `this.frames`; if that array is empty the returned value is undefined and the guard fires. A particle must have a texture frame to render.
Source
Thrown at src/gameobjects/particles/Particle.js:462
{
var emitter = this.emitter;
var ops = emitter.ops;
var anim = emitter.getAnim();
if (anim)
{
this.anims.play(anim);
}
else
{
this.frame = emitter.getFrame();
this.texture = this.frame.texture;
}
if (!this.frame)
{
throw new Error('Particle has no texture frame');
}
// Updates particle.x and particle.y during this call
emitter.getEmitZone(this);
if (x === undefined)
{
this.x += ops.x.onEmit(this, 'x');
}
else if (ops.x.steps > 0)
{
// EmitterOp is stepped but x was forced (follower?) so use it
this.x += x + ops.x.onEmit(this, 'x');
}
else
{
this.x += x;
}View on GitHub (pinned to 41be1e462b)
Solutions
- Ensure the texture key passed to the emitter config exists and has loaded (check `this.textures.exists(key)`).
- Load the texture in `preload()` and only create the emitter in `create()` after the loader completes.
- If using an atlas, verify the frame name(s) exist via `this.textures.get(key).has(frameName)`.
- Provide a `defaultFrame`/valid frames list so `getFrame()` always returns a Frame.
Example fix
// before
this.add.particles(0, 0, 'missingKey', { speed: 100 })
// after
// in preload()
this.load.image('spark', 'assets/spark.png')
// in create()
this.add.particles(0, 0, 'spark', { speed: 100 }) Defensive patterns
Strategy: validation
Validate before calling
const key = 'spark'
if (!this.textures.exists(key)) {
console.error(`Texture '${key}' not loaded; cannot create emitter`)
} else {
this.add.particles(0, 0, key, { speed: 100 })
} Type guard
const textureHasFrame = (textures, key, frame) => {
if (!textures.exists(key)) return false
const tex = textures.get(key)
return frame == null || tex.has(frame)
} Prevention
- Load textures in preload() and build emitters in create() after the loader resolves.
- Verify texture keys with this.textures.exists(key) before referencing them.
- For atlases, check tex.has(frameName) for each frame the emitter config names.
When it happens
Trigger: Creating a ParticleEmitter whose texture key does not exist in the TextureManager, or whose texture has no frames; calling `setTexture` with a non-existent key; emitting before the texture finished loading. Also when a custom emit config selects frames from an empty `frames` array.
Common situations: Loading a texture with a wrong key, misspelling the texture key in the emitter config, or referencing an atlas frame that doesn't exist. Also calling `emitter.explode()`/`emitParticleAt()` synchronously in `create()` when the asset loader hasn't completed.
Related errors
AI-assisted analysis of phaserjs/phaser@41be1e462b (2026-08-13).
Data as JSON: /api/errors/097f7608da713e4b.
Report an issue: GitHub.