# Error: line 1:1: expected object or array but found ' '

**URL:** <https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762>\
**Category:** The Toolbox\
**Created:** [November 4, 2014, 7:40pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762 "2014-11-04T19:40:38Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lanceo90](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/lanceo90/32/137_2.png) [@Lanceo90](https://discourse.cataclysmdda.org/u/Lanceo90)\
**Post date:** [November 4, 2014, 7:40pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/1 "2014-11-04T19:40:38Z")

</div>

Thought I had things down, but after making my item file for my broken anamatronics I the debug: error loading data from json: data/mods//anamatronics/melee.json line 1:1: expected object or array but found ’ ’

Mod folder laylout looks like this, if this matters:  
[![](https://dl.dropboxusercontent.com/s/u9bsn9vj7m6bjft/Screenshot%202014-11-04%2013.30.01.png?dl=0) ](https://dl.dropboxusercontent.com/s/u9bsn9vj7m6bjft/Screenshot%202014-11-04%2013.30.01.png?dl=0)

Code for the melee.json is:

> [{ "type":"GENERIC", "id": "broken\_animatronic\_fox", "symbol": "%", "color": "red", "name": "broken animatronic fox", "category": "other", "description": "A broken animatronic fox. Much less threatening now that it won't be calling for backup. Could be gutted for parts.", "price": 1000, "material": ["steel", "plastic"], "weight": 17023, "volume": 30, "bashing": 10, "cutting": 6, "to\_hit": -2 }, { "type":"GENERIC", "id": "broken\_animatronic\_bunny", "symbol": "%", "color": "blue", "name": "broken animatronic bunny", "category": "other", "description": "A broken animatronic bunny. Much less threatening now that it won't be calling for backup. Could be gutted for parts.", "price": 1000, "material": ["steel", "plastic"], "weight": 17023, "volume": 30, "bashing": 10, "cutting": 6, "to\_hit": -2 }, { "type":"GENERIC", "id": "broken\_animatronic\_chicken", "symbol": "%", "color": "yellow", "name": "broken animatronic chicken", "category": "other", "description": "A broken animatronic chicken. Much less threatening now that it won't be calling for backup. Could be gutted for parts.", "price": 1000, "material": ["steel", "plastic"], "weight": 17023, "volume": 30, "bashing": 10, "cutting": 6, "to\_hit": -2 }, { "type":"GENERIC", "id": "broken\_animatronic\_bunny", "symbol": "%", "color": "brown", "name": "broken animatronic bear", "category": "other", "description": "A broken animatronic bear. Much less threatening now that it won't be calling for backup. Could be gutted for parts.", "price": 1000, "material": ["steel", "plastic"], "weight": 17023, "volume": 30, "bashing": 10, "cutting": 6, "to\_hit": -2
> 
> }  
> ]

---

<div class="post-metadata">

**Author:** ![TheFlame52](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/theflame52/32/247_2.png) [@TheFlame52](https://discourse.cataclysmdda.org/u/TheFlame52)\
**Post date:** [November 4, 2014, 7:43pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/2 "2014-11-04T19:43:14Z")

</div>

It might be that items can’t be made of more than two materials.

---

<div class="post-metadata">

**Author:** ![Lanceo90](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/lanceo90/32/137_2.png) [@Lanceo90](https://discourse.cataclysmdda.org/u/Lanceo90)\
**Post date:** [November 4, 2014, 7:52pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/3 "2014-11-04T19:52:54Z")

</div>

> [@TheFlame52](#):
>
> It might be that items can’t be made of more than two materials.

Didn’t fix it. Though that might also be a problem, right now it’s stuck on this issue though.

---

<div class="post-metadata">

**Author:** ![Rivet](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/rivet/32/11_2.png) [@Rivet](https://discourse.cataclysmdda.org/u/Rivet)\
**Post date:** [November 4, 2014, 8:01pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/4 "2014-11-04T20:01:49Z")

</div>

> [@TheFlame52](#):
>
> items can’t be made of more than two materials.

This right here.

Also: It’s animatronic not anamatronic and it’s not its.

---

<div class="post-metadata">

**Author:** ![Lanceo90](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/lanceo90/32/137_2.png) [@Lanceo90](https://discourse.cataclysmdda.org/u/Lanceo90)\
**Post date:** [November 4, 2014, 8:05pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/5 "2014-11-04T20:05:53Z")

</div>

> [@Rivet](#):
>
> [quote=“TheFlame52, post:2, topic:7762”]items can’t be made of more than two materials.

This right here.

Also: It’s animatronic not anamatronic and it’s not its.[/quote]

Again it’s not that, I brought it down to two and its still not functioning. Thanks for the grammar corrections though.

---

<div class="post-metadata">

**Author:** ![Rivet](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/rivet/32/11_2.png) [@Rivet](https://discourse.cataclysmdda.org/u/Rivet)\
**Post date:** [November 4, 2014, 8:09pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/6 "2014-11-04T20:09:01Z")

</div>

You aren’t adding new square brackets to the melee.json file are you?

Just insert the stuff within the curly brackets (curly brackets too) inside the existing structure (make sure you put your commas in the right places).

---

<div class="post-metadata">

**Author:** ![Lanceo90](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/lanceo90/32/137_2.png) [@Lanceo90](https://discourse.cataclysmdda.org/u/Lanceo90)\
**Post date:** [November 4, 2014, 8:27pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/7 "2014-11-04T20:27:26Z")

</div>

Tried doing it from scratch again to be sure, still get the same error.

Here’s the file [https://www.dropbox.com/s/v25hd6hzbgez2ih/melee.json?dl=0](https://www.dropbox.com/s/v25hd6hzbgez2ih/melee.json?dl=0)

---

<div class="post-metadata">

**Author:** ![Rivet](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/rivet/32/11_2.png) [@Rivet](https://discourse.cataclysmdda.org/u/Rivet)\
**Post date:** [November 4, 2014, 8:50pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/8 "2014-11-04T20:50:42Z")

</div>

I just tried adding the items into the end of an updated copy of melee.json.

[Pastebin post.](http://pastebin.com/cXx3LiT3)

It works just fine.

---

<div class="post-metadata">

**Author:** ![Lanceo90](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/lanceo90/32/137_2.png) [@Lanceo90](https://discourse.cataclysmdda.org/u/Lanceo90)\
**Post date:** [November 4, 2014, 9:05pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/9 "2014-11-04T21:05:15Z")

</div>

[quote=“Rivet, post:8, topic:7762”]I just tried adding the items into the end of an updated copy of melee.json.

[Pastebin post.](http://pastebin.com/cXx3LiT3)

It works just fine.[/quote]

When I downloaded it it was a txt file. I copy pasted the contents over the text in a json. I still get the same message

Maybe there’s just something wrong with the experimental build of Cataclysm I’m using? Should I switch to the last stable release?

EDIT: Last stable release has a differant issue entirely. So guessing not.

Newest Experimental throws up the original problem still.

---

<div class="post-metadata">

**Author:** ![Rivet](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/rivet/32/11_2.png) [@Rivet](https://discourse.cataclysmdda.org/u/Rivet)\
**Post date:** [November 4, 2014, 9:09pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/10 "2014-11-04T21:09:41Z")

</div>

Just copy the raw file contents out and overwrite the contents of melee.json.

And no, downgrading back to the stable is never advisable when making new stuff.

---

<div class="post-metadata">

**Author:** ![Lanceo90](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/lanceo90/32/137_2.png) [@Lanceo90](https://discourse.cataclysmdda.org/u/Lanceo90)\
**Post date:** [November 4, 2014, 9:11pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/11 "2014-11-04T21:11:30Z")

</div>

> [@Rivet](#):
>
> Just copy the raw file contents out and overwrite the contents of melee.json.

That’s what I did, I still get the same error.

---

<div class="post-metadata">

**Author:** ![Rivet](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/rivet/32/11_2.png) [@Rivet](https://discourse.cataclysmdda.org/u/Rivet)\
**Post date:** [November 4, 2014, 9:16pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/12 "2014-11-04T21:16:04Z")

</div>

I just re-read and noticed you’re creating a separate melee.json in your mod directory. I’m not sure how that will interact with the extant main melee.json file. Try renaming the file itself (to something like main.json) and using your original file contents (i.e. your OP).

---

<div class="post-metadata">

**Author:** ![Lanceo90](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/lanceo90/32/137_2.png) [@Lanceo90](https://discourse.cataclysmdda.org/u/Lanceo90)\
**Post date:** [November 4, 2014, 9:24pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/13 "2014-11-04T21:24:43Z")

</div>

> [@Rivet](#):
>
> I just re-read and noticed you’re creating a separate melee.json in your mod directory. I’m not sure how that will interact with the extant main melee.json file. Try renaming the file itself (to something like main.json) and using your original file contents (i.e. your OP).

I originally had it like that, I changed the name to melee when I had the error thinking it needed to have that name to work. At any rate, I just tested that again just in case and got the same error.

I just looked at a item mod from a newer experimental build. The order of “id” and “type” are reversed, could that be it?

Anyway while I test that, here is the whole mod as a whole right now [Dropbox - Error - Simplify your life](https://www.dropbox.com/s/crcavd12y02gn5x/Animatronics%20%28broken%29.zip?dl=0)

---

<div class="post-metadata">

**Author:** ![Rivet](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/rivet/32/11_2.png) [@Rivet](https://discourse.cataclysmdda.org/u/Rivet)\
**Post date:** [November 4, 2014, 9:42pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/14 "2014-11-04T21:42:55Z")

</div>

> [@Lanceo90](#):
>
> The order of “id” and “type” are reversed, could that be it?

That shouldn’t affect anything.

Just from looking at the contents of the broken file, I can’t see what would be wrong with it.

---

<div class="post-metadata">

**Author:** ![Lanceo90](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/lanceo90/32/137_2.png) [@Lanceo90](https://discourse.cataclysmdda.org/u/Lanceo90)\
**Post date:** [November 4, 2014, 9:46pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/15 "2014-11-04T21:46:18Z")

</div>

> [@Rivet](#):
>
> [quote=“Lanceo90, post:13, topic:7762”]The order of “id” and “type” are reversed, could that be it?

That shouldn’t affect anything.

Just from looking at the contents of the broken file, I can’t see what would be wrong with it.[/quote]

I can’t figure it out either, but keep getting the: error loading data from json: data/mods//anamatronics/melee.json line 1:1: expected object or array but found ’ ’

Not sure what else to do, I got to get it to work though or else I’ll keep getting that debug pop up when I kill them about not having the broken body defined

---

<div class="post-metadata">

**Author:** ![Rivet](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/rivet/32/11_2.png) [@Rivet](https://discourse.cataclysmdda.org/u/Rivet)\
**Post date:** [November 4, 2014, 9:47pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/16 "2014-11-04T21:47:52Z")

</div>

Okay I’ve got it to load. Just need to locate a pizzeria to see if it’s actually working now. I’ll post a fixed zip file ASAP.

---

<div class="post-metadata">

**Author:** ![Lanceo90](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/lanceo90/32/137_2.png) [@Lanceo90](https://discourse.cataclysmdda.org/u/Lanceo90)\
**Post date:** [November 4, 2014, 9:54pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/17 "2014-11-04T21:54:02Z")

</div>

> [@Rivet](#):
>
> Okay I’ve got it to load. Just need to locate a pizzeria to see if it’s actually working now. I’ll post a fixed zip file ASAP.

Awesome thank you.

The spawn rate for them should be high for them right now, they are dark grey ^

---

<div class="post-metadata">

**Author:** ![Rivet](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/rivet/32/11_2.png) [@Rivet](https://discourse.cataclysmdda.org/u/Rivet)\
**Post date:** [November 4, 2014, 9:54pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/18 "2014-11-04T21:54:28Z")

</div>

Found a few other minor bugs which needed fixing as well.

[Fixed files are here.](http://s000.tinyupload.com/index.php?file_id=91229794388143875259)

---

<div class="post-metadata">

**Author:** ![Lanceo90](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/lanceo90/32/137_2.png) [@Lanceo90](https://discourse.cataclysmdda.org/u/Lanceo90)\
**Post date:** [November 4, 2014, 9:57pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/19 "2014-11-04T21:57:55Z")

</div>

[quote=“Rivet, post:18, topic:7762”]Found a few other minor bugs which needed fixing as well.

[Fixed files are here.](http://s000.tinyupload.com/index.php?file_id=91229794388143875259)[/quote]

Awesome thank you.

What was the problem? And what are the other bugs?

---

<div class="post-metadata">

**Author:** ![Rivet](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/rivet/32/11_2.png) [@Rivet](https://discourse.cataclysmdda.org/u/Rivet)\
**Post date:** [November 4, 2014, 10:02pm UTC](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762/20 "2014-11-04T22:02:52Z")

</div>

Something inherently wrong in the dead\_animatronics.json file itself, possibly bad newlines; I made a fresh .json and copied the contents inside and it loaded fine.

Bugs were a duplicated ID (not the root problem though) and some common copy/paste errors.

By the by, what program are you using to edit your .jsons?

[Next page](https://discourse.cataclysmdda.org/t/error-line-1-1-expected-object-or-array-but-found/7762.md?page=2)
