prismicio / prismic-ts-codegen

A Prismic model-to-TypeScript-type generator.
Apache License 2.0
18 stars 6 forks source link

PrismicError: An invalid API response was returned #33

Closed AugusDogus closed 2 years ago

AugusDogus commented 2 years ago

Versions

Reproduction

Can provide privately if required.

Additional Details
[package.json ](https://gist.github.com/AugusDogus/643891f0be93122131ce2d926cb7638a) [logs.sh](https://gist.github.com/AugusDogus/329561c5958459dd91b243f934e0ddce)

Steps to reproduce

  1. Run npx prismic-ts-codegen init
  2. Configure the config file for loading remote models from the repo amli-website-dev.
  3. Run npx prismic-ts-codegen

What is expected?

The types file is generated.

What is actually happening?

The codegen errors out with PrismicError: An invalid API response was returned

Not sure if this is an actual bug with prismic-ts-codegen or if there's an issue with the https://customtypes.prismic.io/customtypes/ API. I tried rolling back to v0.1.1 which I had previous success with, but it also did not work and gave the same error.

I thought perhaps my customTypesAPIToken had been removed, but I checked my repo and it was still there. I also added a console log to my prismicCodegen.config.ts to validate that it was being parsed through dotenv properly.

angeloashmore commented 2 years ago

Hi @AugusDogus, thanks for the report. It looks like an issue with the Custom Types API endpoint, not prismic-ts-codegen directly.

To properly diagnose the issue, I would need your Prismic repository name and a Custom Type API token. Are you comfortable sharing those with me privately?

You can send me a message on Prismic's Community Forum here: https://community.prismic.io/new-message?username=angeloashmore&title=prismic-ts-codegen%20GitHub%20Issue%2033

Thanks!

AugusDogus commented 2 years ago

Hi @angeloashmore, thanks for reaching out!

I sent you a message via Prismic's Community Forum a couple days ago, but replying here also for documentation reasons.

I am happy to provide those, but I would prefer to do that via email if that's something you're comfortable with.

Thanks!

angeloashmore commented 2 years ago

Hey @AugusDogus, sorry about the delay. I don't get notifications for the forum and I unfortunately missed your message. I just replied. 🙂

angeloashmore commented 2 years ago

I'm closing this issue since it appears to be a bug in the Custom Types API rather than prismic-ts-codegen.

@AugusDogus or I will follow up in this issue once resolved for anyone who may come across this page in the future. 👍