# TypeMismatchError after editing map

**URL:** <https://discourse.mapeditor.org/t/typemismatcherror-after-editing-map/1366>\
**Category:** Questions\
**Created:** [May 14, 2016, 9:34pm UTC](https://discourse.mapeditor.org/t/typemismatcherror-after-editing-map/1366 "2016-05-14T21:34:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jimjim](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@jimjim](https://discourse.mapeditor.org/u/jimjim)\
**Post date:** [May 14, 2016, 9:34pm UTC](https://discourse.mapeditor.org/t/typemismatcherror-after-editing-map/1366/1 "2016-05-14T21:34:58Z")

</div>

Hi all,

I’ve just started contributing to a game on Github and they are using Tiled, I’ve never used it before. The game works fine and the map is saved as a .JSON file. The .TMX is provided in the repository.

On my system, If I add anything to the map in Tiled then export a new .JSON file, the game wont run and I get the following error:

```
[Error] TypeMismatchError: DOM Exception 17: The type of an object was incompatible with the expected type of the parameter associated to the object.
	drawImage
	draw
	renderRegion
	renderFull
	render
	postUpdate
	postUpdate
	postUpdate
	updateLogic
	update
	updateRAF
	_onLoop

```

This happens when I add one of the pre-existing tilesets, any of them.

I’m using Tiled Map Editor Version 0.16.1 on Mac OSX 10.11.2 the problem occurs in both Safari and Chrome.

---

<div class="post-metadata">

**Author:** ![Ablu](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/ablu/32/1496_2.png) [@Ablu](https://discourse.mapeditor.org/u/Ablu)\
**Post date:** [May 15, 2016, 9:37am UTC](https://discourse.mapeditor.org/t/typemismatcherror-after-editing-map/1366/2 "2016-05-15T09:37:01Z")

</div>

This sounds like the game you are making maps for has an issue with some kind of new tiled features… I fear you will need to debug your game there… The issue does not seem to be within tiled here (unless it is some kind of unwanted backwards incompatibility).

Would be nice if you could report back what the issue was… Was it some kind of new property?

Regards,  
Ablu

---

<div class="post-metadata">

**Author:** ![jimjim](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@jimjim](https://discourse.mapeditor.org/u/jimjim)\
**Post date:** [May 15, 2016, 12:27pm UTC](https://discourse.mapeditor.org/t/typemismatcherror-after-editing-map/1366/3 "2016-05-15T12:27:15Z")

</div>

Thanks for the reply Ablu, I’m still investigating the problem. I’ve narrowed it down to adding certain items within the game, specifically the “Jetpack”. Here’s the project on Github:

> **[Awesome-Game-Team/Awesome-Game](https://github.com/Awesome-Game-Team/Awesome-Game)**
>
> An Awesome Game. Contribute to Awesome-Game-Team/Awesome-Game development by creating an account on GitHub.

When I get it figured out I’ll report back 🙂

//Jim

---

<div class="post-metadata">

**Author:** ![jimjim](https://avatars.discourse-cdn.com/v4/letter/j/2acd7d/32.png) [@jimjim](https://discourse.mapeditor.org/u/jimjim)\
**Post date:** [May 15, 2016, 6:08pm UTC](https://discourse.mapeditor.org/t/typemismatcherror-after-editing-map/1366/4 "2016-05-15T18:08:59Z")

</div>

Ok, finally worked out what was wrong, I was adding the jetpacks to the world layer - doh!  
They should be on the objects layer so that the javascript code can find them.

School boy error!

---

<div class="post-metadata">

**Author:** ![Ablu](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.mapeditor.org/ablu/32/1496_2.png) [@Ablu](https://discourse.mapeditor.org/u/Ablu)\
**Post date:** [May 15, 2016, 6:50pm UTC](https://discourse.mapeditor.org/t/typemismatcherror-after-editing-map/1366/5 "2016-05-15T18:50:42Z")

</div>

glad you found it 🙂

Regards,  
Ablu
