# Scale Manager: not working?

**URL:** <https://phaser.discourse.group/t/scale-manager-not-working/4499>\
**Category:** Phaser 3\
**Created:** [December 7, 2019, 9:52pm UTC](https://phaser.discourse.group/t/scale-manager-not-working/4499 "2019-12-07T21:52:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![casey](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/casey/32/2503_2.png) [@casey](https://phaser.discourse.group/u/casey)\
**Post date:** [December 7, 2019, 9:52pm UTC](https://phaser.discourse.group/t/scale-manager-not-working/4499/1 "2019-12-07T21:52:05Z")

</div>

I can’t seem to get any of the Scale Manager examples to work. I am copying the exact code from the examples posted for resize or fit, or any of the other that use scale manager.  
all the time,throws the same error:  
" cannot read property ‘FIT’ of undefined at config.js: 5 which is the line mode: Phaser.Scale.FIT,

if I change to RESIZE it gives the same error.  
What am I doing wrong?  
var config = {  
type: Phaser.AUTO,  
backgroundColor: ‘#2dab2d’,  
scale: {  
mode: Phaser.Scale.RESIZE,  
parent: ‘phaser-example’,  
width: ‘100%’,  
height: ‘100%’,  
min: {  
width: 800,  
height: 600  
},  
max: {  
width: 1600,  
height: 1200  
}  
},  
scene: {  
preload: preload,  
create: create  
}  
};

var game = new Phaser.Game(config);

function preload ()  
{  
this.load.image(‘rain’, ‘assets/pics/thalion-rain.png’);  
this.load.image(‘logo’, ‘assets/sprites/phaser3-logo-x2.png’);  
}

function create ()  
{  
this.bg = this.add.tileSprite(0, 0, this.scale.width, this.scale.height, ‘rain’).setOrigin(0);  
this.logo = this.add.sprite(this.scale.width / 2, this.scale.height / 2, ‘logo’);

```
this.scale.on('resize', resize, this);

```

}

function resize (gameSize, baseSize, displaySize, resolution)  
{  
var width = gameSize.width;  
var height = gameSize.height;

```
this.cameras.resize(width, height);

this.bg.setSize(width, height);
this.logo.setPosition(width / 2, height / 2);

```

}

---

<div class="post-metadata">

**Author:** ![julianos](https://avatars.discourse-cdn.com/v4/letter/j/e47c2d/32.png) [@julianos](https://phaser.discourse.group/u/julianos)\
**Post date:** [December 8, 2019, 8:44am UTC](https://phaser.discourse.group/t/scale-manager-not-working/4499/2 "2019-12-08T08:44:52Z")

</div>

If you dont use the newest version of phaser3.16 or higher you still have the same error ,try to change phaser is version in the code example!

---

<div class="post-metadata">

**Author:** ![casey](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/casey/32/2503_2.png) [@casey](https://phaser.discourse.group/u/casey)\
**Post date:** [December 8, 2019, 3:41pm UTC](https://phaser.discourse.group/t/scale-manager-not-working/4499/3 "2019-12-08T15:41:52Z")

</div>

Thank you for replying.Brilliant! I had made the mistake of downloading it off Github which I guess has not been updated for a while.
