Malformed JSON response in document.type request

Hello, I'm getting malformed JSON responses when querying a specific page, https://barisabel.cdn.prismic.io/api/v2/documents/search?ref=YGH1SRAAACIAK-NL&q=[[at(document.type, "drinks")]] (this is the actual response, i.e. it is broken after the 'results' property):

{"page":1,"results_per_page":20,"results_size":1,"total_results_size":1,"total_pages":1,"next_page":null,"prev_page":null,"results":[

This has occurred to people in other threads where they have links to documents that were removed, but this type doesn't have any links, just slices of text-based content.

Requesting data for other content types works. This content is fetched properly when viewing it in your API browser under the HTML format but displays an error when viewing it in the JSON format.

I'm using Nuxt.js but I've isolated this issue to something on your end or with my content (e.g., bad characters somewhere?) so I've posted it in the REST API forum -- I'm wondering if your team might have any ideas what is going on?

1 Like

Hi Matt,

Welcome to the Prismic community.
This might be caused by some special character breaking the JSON construction in our backend as you said.

I have been able to reproduce the issue and I will create an issue in our tracker to have somebody from our dev team to work on it, and we will let you know once we get some info.

Best,
Fares

1 Like

Hi Fares,

This seemed to have resolved itself a few weeks ago, but I'm encountering the same issue again and I can't publish updates to my site. Has your dev team been able to track down what might be occurring?

Thanks,
Matt

Hi Matt,

A fix has been done for this and being deployed progressively.

Hmm, sorry -- Still seeing the error, e.g. through the link I posted at the beginning of this thread.

Hi Matt,

As I have mentioned before, the issue has been fixed and we are deploying it progressively (currently deployed for a few repositories)

If would like we can give alpha access to this fix if you need it urgently (need to give us the repository/s that you want to activate if for).

Ah -- Sorry, I didn't understand what you meant by a progressive deployment.

It would be great if you could give my 'barisabel' repository alpha access, thank you!

1 Like

Hi Matt,

We are currently doing some final tests on this fix, and I will let you know once it will be available for alpha testing.

1 Like

Hi Matt,

May I know if you are using Slice Machine?

Hi Fares -- No, this was created well before that was available so I'm not using it.

1 Like

Hello!

My newly created repository (using Slice Machine, no broken links) is having the same problem. The repository is system76 and the exact URL that is causing the problem is:

https://system76.cdn.prismic.io/api/v2/documents/search?page=1&pageSize=1&ref={"_tracker"%3A"qj0hiZ83"%2C"system76.prismic.io"%3A{"preview"%3A"https%3A%2F%2Fsystem76.prismic.io%2Fpreviews%2FYNKNeRAAACIAAOmH%3FwebsitePreviewId%3DYNI7uBAAACIA_3pm"}}&q=[[at(my.careers-posting.uid%2C%20"director-of-web-development")]]

Hey @hosting, the fix for this issue should be now present in all repositories.
Let us know if you experience this or any other error related to this.

Thanks

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.