Common Error for importing JSON documents for new blog post

I’m writing a script to construct the correct prismic import json from the wordpress api, which all goes well. However, when I import the documents on the prismic platform, there are error messages in the json which aren’t super specific as far as where they’re occurring and there isn’t anything obviously off with the json (screenshot of error attached). The json is valid and there aren’t any notable discrepancies between the problematic json and any other successful json document (both are generated in the same way). The error is always the same message, and always points to simply the beginning of the slices array in the json. I’ve checked the obvious, there don’t seem to be missing “text” fields.
I am also able to successfully see a preview of the entire post that the json would create while it’s uploading, before it fails, with all of the slices that the json is supposed to generate intact.
Wondering if anyone else has seen this one single error I’ve come across so far, and if so what it’s referring to.
If someone from Prismic sees this I’d be happy to forward the actual json file, but even just knowing the general issue the error is referring to would be helpful.


Thank you!

Hello @zach, thank you for reaching out to us, sorry for missing out on answering to you earlier.

Are you still experiencing this issue? if you do, It’ll be helpful if you can share the JSON file with me in a private message so that I can test it on my side.

Thanks!

Hi Paulina,
I was able to resolve the issue, looks like if any field’s value is an empty string it will remove that key value pair for some reason and that missing field will cause the error. Could be useful in the docs but was able to figure it out with just a closer eye!
Thanks for your help,
Zach

1 Like