# \[Help for a Newb Please\] Tiled Error: "Invalid Tileset Image: floortileset"

**URL:** <https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256>\
**Category:** Phaser 3\
**Created:** [August 23, 2020, 7:09pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256 "2020-08-23T19:09:04Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![arhedg](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@arhedg](https://phaser.discourse.group/u/arhedg)\
**Post date:** [August 23, 2020, 7:09pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256/1 "2020-08-23T19:09:04Z")

</div>

**In trying to import my map from Tiled, I am getting the following error:**

[![r/phaser - [Help] Tiled Error: "Invalid Tileset Image: floortileset"](https://preview.redd.it/09pr78desoi51.png?width=913&format=png&auto=webp&s=90eba5389688eac4486efbb76f838b0d55d91d85)](https://preview.redd.it/09pr78desoi51.png?width=913&format=png&auto=webp&s=90eba5389688eac4486efbb76f838b0d55d91d85)

**Any suggestions? I included the bits of code I thought were relevant here (omitted spritesheets, etc)**

Preload()

```javascript
this.load.image("floortileset", 'floortileset.png');

var json = require('./map.json');
this.load.tilemapTiledJSON(this.MK, json);

```

Create()

```javascript
this.Map = this.make.tilemap({key: this.MK});
const tileset = this.Map.addTilesetImage("..\/agora\/front\/src\/Phaser\/Game\/floortileset.png", "floortileset");

const starter = this.Map.createStaticLayer("start", tileset);
const worldLayer = this.Map.createStaticLayer("Tile Layer 1", tileset);

```

Can also include the json file if it would be helpful! Would really appreciate any help I have spent days on this already.

---

<div class="post-metadata">

**Author:** ![Milton](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@Milton](https://phaser.discourse.group/u/Milton)\
**Post date:** [August 23, 2020, 7:34pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256/2 "2020-08-23T19:34:52Z")

</div>

Are you sure the path to the png is correct? Check the Network tab in Dev Tools.  
And your key is strange, I can’t tell what ‘this.MK’ is. Something like {key: “map”} is more obvious.

---

<div class="post-metadata">

**Author:** ![arhedg](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@arhedg](https://phaser.discourse.group/u/arhedg)\
**Post date:** [August 23, 2020, 7:47pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256/3 "2020-08-23T19:47:52Z")

</div>

I got the path to the png based on the JSON file provided to me by Tiled. It is in the same folder as this file, and substituting in “./floortileset.png” unfortunately doesn’t solve it either.

this.MK is the map key (‘MK’) I store within the class that this exists within. I tried substituting just “map” into both “this.MK” and no success here either ☹

---

<div class="post-metadata">

**Author:** ![Milton](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@Milton](https://phaser.discourse.group/u/Milton)\
**Post date:** [August 23, 2020, 8:03pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256/4 "2020-08-23T20:03:40Z")

</div>

But did you check the Network tab? If it gives a 404, it’ll tell you what path it expects.

---

<div class="post-metadata">

**Author:** ![arhedg](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@arhedg](https://phaser.discourse.group/u/arhedg)\
**Post date:** [August 23, 2020, 8:13pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256/5 "2020-08-23T20:13:12Z")

</div>

Am not seeing anything under the network tab, or any 404 error in console logs.

---

<div class="post-metadata">

**Author:** ![BlunT76](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/blunt76/32/1454_2.png) [@BlunT76](https://phaser.discourse.group/u/BlunT76)\
**Post date:** [August 23, 2020, 8:14pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256/6 "2020-08-23T20:14:59Z")

</div>

Hi,  
Try this:

> [@arhedg](#):
>
> ```javascript
> this.load.image("floortileset", '/your_folder_assets/floortileset.png'); // check in dev tools, network tab if the path is good, like Milton said
> 
> var json = require('./map.json');
> this.load.tilemapTiledJSON('map1', json); // 'map1' but can be anything
> 
> ```
> 
> Create()
> 
> ```javascript
> this.Map = this.make.tilemap({key: 'map1', tileWidth: 16, tileHeight: 16});
> const tileset = this.Map.addTilesetImage('Tile Layer 1', 'floortileset', 16, 16); // 16 are tiles sizes, i use them but perhaps it's not needed
> 
> const starter = this.Map.createStaticLayer("start", tileset); // start must correspond to a tiled layer
> const worldLayer = this.Map.createStaticLayer("Tile Layer 1", tileset); Tile Layer 1 must correspond to a tiled layer
> 
> ```

And in Tiled, when you create a map, you must choose embedded tileset (or something like this, i don’t remember the exact term

---

<div class="post-metadata">

**Author:** ![Milton](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@Milton](https://phaser.discourse.group/u/Milton)\
**Post date:** [August 23, 2020, 8:24pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256/7 "2020-08-23T20:24:53Z")

</div>

> [@arhedg](#):
>
> Am not seeing anything under the network tab, or any 404 error in console logs.

Press CTRL-F5 or CTRL-r when in the Network Tab. Does it say 200 or 404?  
It can’t say nothing.

![network](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/8/8d7e28619b7a0895386dcf29617711a4e7dacc8a.png)

---

<div class="post-metadata">

**Author:** ![arhedg](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@arhedg](https://phaser.discourse.group/u/arhedg)\
**Post date:** [August 23, 2020, 8:25pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256/8 "2020-08-23T20:25:16Z")

</div>

Still seems to be an error @BlunT76 , thank you though.

start and Tile Layer 1 are both tiled layers: ` "type":"tilelayer",`

Perhaps my path in the JSON is wrong? I currently have

```
"tilesets":[
        {
         "columns":8,
         "firstgid":1,
         "image":"..\/agora\/front\/src\/Phaser\/Game\/floortileset.png",
         "imageheight":272,
         "imagewidth":272,
         "margin":1,
         "name":"floortileset",
         "spacing":2,
         "tilecount":64,
         "tileheight":32,
         "tilewidth":32

```

}],

Edit: And I did do the embedded tilesheet option

---

<div class="post-metadata">

**Author:** ![arhedg](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@arhedg](https://phaser.discourse.group/u/arhedg)\
**Post date:** [August 23, 2020, 8:26pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256/9 "2020-08-23T20:26:30Z")

</div>

Ah, thanks, I am seeing 304 for most things.

---

<div class="post-metadata">

**Author:** ![arhedg](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@arhedg](https://phaser.discourse.group/u/arhedg)\
**Post date:** [August 23, 2020, 9:03pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256/10 "2020-08-23T21:03:10Z")

</div>

If it helps, here is a screenshot of my GameScene object

 ![image](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/d/dbe992715dce5844c5c83a5a92171963b3ca6a38.png)

---

<div class="post-metadata">

**Author:** ![BlunT76](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/blunt76/32/1454_2.png) [@BlunT76](https://phaser.discourse.group/u/BlunT76)\
**Post date:** [August 23, 2020, 9:11pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256/11 "2020-08-23T21:11:58Z")

</div>

Do you have your project on github or somewhere else to test it?

---

<div class="post-metadata">

**Author:** ![arhedg](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@arhedg](https://phaser.discourse.group/u/arhedg)\
**Post date:** [August 23, 2020, 9:23pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256/12 "2020-08-23T21:23:01Z")

</div>

I’ll put it up in a sec – I am just playing around with another repository and trying to get it to run on my localhost for my own education.

That said, I might have gotten closer to figuring it out. I am seeing that “const tileset” is null after adding the tileset image, which makes me think it’s not being loaded properly.

---

<div class="post-metadata">

**Author:** ![Milton](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@Milton](https://phaser.discourse.group/u/Milton)\
**Post date:** [August 23, 2020, 9:26pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256/13 "2020-08-23T21:26:20Z")

</div>

> [@arhedg](#):
>
> Ah, thanks, I am seeing 304 for most things.

I’m still not convinced 🙂  
Could you check disable cache (in the Network tab header) , and post the result of you hovering over ‘floortileset.png’?  
Like this:  
 ![path2](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/2/27cd7e81cf3628fbefc13ae11a66889cee8d73c1.png)

---

<div class="post-metadata">

**Author:** ![arhedg](https://avatars.discourse-cdn.com/v4/letter/a/dc4da7/32.png) [@arhedg](https://phaser.discourse.group/u/arhedg)\
**Post date:** [August 23, 2020, 9:53pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256/14 "2020-08-23T21:53:31Z")

</div>

@Milton lol, well you were right I was looking at the wrong thing but looks like it is 200.

 ![image](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/7/7c0d403e7b00a05d874f770b9cc55e5d1b871f36.png)

---

<div class="post-metadata">

**Author:** ![Milton](https://avatars.discourse-cdn.com/v4/letter/m/87869e/32.png) [@Milton](https://phaser.discourse.group/u/Milton)\
**Post date:** [August 23, 2020, 10:17pm UTC](https://phaser.discourse.group/t/help-for-a-newb-please-tiled-error-invalid-tileset-image-floortileset/7256/15 "2020-08-23T22:17:53Z")

</div>

Another thing I noticed:  
tilesetName - The name of the tileset as specified in the map data

Shouldn’t be the problem, but change it to addTileSetImage(“floortileset”); // or whatever you called it in Tiled.

Maybe look at [this](https://stackabuse.com/phaser-3-and-tiled-building-a-platformer/) tutorial.
