Gatsby-source-prismic - unable to access the Prismic repository

Firstly, I'd like to say I love the way this CMS works for editing and creating types etc., so I'd really like to use it in a client project.
However, I'm having some issues linking this to a Gatsby site. I've followed the documentation, but can't seem to get my gatsby-source-prismic plugin set up.

When running gatsby develop and starting the dev server, build fails on loading plugins, specifically on the gatsby-source-prismic plugin. I get a console message saying:

  • gatsby-source-prismic([repository name]) - Unable to access the Prismic repository. Check that the correct repository name and access token are provided."

I have set up the plugin as follows (all hardcoded in for now):

    resolve: "gatsby-source-prismic",
    options: {
      repositoryName: "[repository name]",
      accessToken: "[access token from API & security => content API => Permanent access tokens]",
      customTypesApiToken: "[token from API & security => custom types API => tokens]" ,

When using the API Browser, I can see my content in there, so I'm thinking it's an issue with configuring the plugin.
Any advice would be greatly appreciated!

Hello @josh.ferriday thanks for reching out.

We need to check what step is breaking in your setup. Where is your gatsby-config.js file getting your project data from?

Hi Pau,
Thank you the response.
At the moment, the project data (accessToken, customTypesApiToken and repository name) are all hard coded into the gastby config file (to eliminate issues with a .env file).

I see. Then it's very odd that it isn't getting it when you run the project. Do you have a screenshot of the error?