Global plugins not mapped on scene when render type is Phaser.HEADLESS
Author: TJ09Created Aug 8, 2026Updated Aug 8, 2026
Version
- Phaser Version: 3.88-3.90
- Operating system: Windows/Linux (Not specific to any)
- Browser: Tested in Firefox/Chrome
Description
As of https://github.com/phaserjs/phaser/commit/8736f0e844c8f924bf129d9364468c2cfa8c250d, plugin keys are not correctly populated on scenes. e.g. a global plugin with a mapping of "test" is not available as scene.test
Example Test Code
This repros with the "global scene plugin" example with no changes other than swapping type to HEADLESS:
class TestPlugin extends Phaser.Plugins.BasePlugin {
constructor (pluginManager)
{
super(pluginManager);
}
wibble ()
{
console.log('hello');
}
}
var config = {
scale: { mode: Phaser.Scale.FIT },
type: Phaser.HEADLESS,
parent: 'game-container',
width: 800,
height: 600,
plugins: {
global: [
{ key: 'TestPlugin', plugin: TestPlugin, start: false, mapping: 'test' }
]
},
scene: {
preload: preload,
create: create
}
};
var game = new Phaser.Game(config);
function preload ()
{
this.load.setBaseURL('https://cdn.phaserfiles.com/v410');
this.load.image('elephant', 'assets/sprites/elephant.png');
}
function create ()
{
this.test.wibble(); // Error: this.test is undefined
}Source: phaserjs/phaser