"Unexpected end of JSON input" when requesting an object via client

Hi there!

I'm trying to fetch a single document from Prismic like this:

import smConfig from "../sm.json";
import Prismic from "@prismicio/client";

const Page = (props) => {

  async function queryDoc() {
    const client = Prismic.client(smConfig.apiEndpoint);
    const document = await client.getByUID("foo-type", "abcdef");

  return <div>Stub</div>;

Then I get an error:

I checked network tab, and found out 2 requests spawned. First one to https://<repo>.prismic.io/api/v2 is OK.

But latter is a bit weird:

Why the response could be trimmed like this?

Web-based REST API works fine with a following query:
[at(my.foo-type.uid, "abcdef")]


Hey @Denis,

This is a strange error. Could you tell me your repo name? (Feel free to send it in a DM.)

Is there any chance that your document is exceptionally large or includes any illegal characters?


Hi Sam,

Sent my repo name to DM. In theory, I could even generate you some temporary access token if it helps, cause my account doesn't contain any sensitive data (yet). And I can always revoke it after the experimentation.

Thanks, Denis! A temporary access token would be great. Could I also get permission to clone your repo to do some debugging?