# Error building with gatsby-source-prismic in the sourceNodes lifecycle

**URL:** <https://community.prismic.io/t/error-building-with-gatsby-source-prismic-in-the-sourcenodes-lifecycle/6419>\
**Category:** Developing with Prismic\
**Tags:** gatsby\
**Created:** [July 28, 2021, 12:28am UTC](https://community.prismic.io/t/error-building-with-gatsby-source-prismic-in-the-sourcenodes-lifecycle/6419 "2021-07-28T00:28:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dune.architect](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/dune.architect/32/2645_2.png) [@dune.architect](https://community.prismic.io/u/dune.architect)\
**Post date:** [July 28, 2021, 12:28am UTC](https://community.prismic.io/t/error-building-with-gatsby-source-prismic-in-the-sourcenodes-lifecycle/6419/1 "2021-07-28T00:28:30Z")

</div>

Hi,

I'm attempting to build my first Gatsby site using the Prismic plugin. I have installed and configured the plugin, connected it to my prismic repository with an access token, and applied my custom types schema. When building I am receiving the following error:

```auto
"gatsby-source-prismic" threw an error while running the sourceNodes lifecycle:

a is not a function

  61 | }
  62 |
> 63 | const buildAll = async (
     | ^
  64 | pluginOptions: PluginOptions,
  65 | gatsbyContext: SourceNodesArgs,
  66 | typePaths: TypePath[],

File: node_modules/gatsby-source-prismic/src/gatsby-node.ts:63:15

```

As far as I can tell I have followed the installation and setup instructions correctly. From looking at other issues, this may be some kind of issue with my `front_page` custom type? I am unsure how to proceed. I am using **gatsby-source-prismic 3.3.6**

gatsby-config and my custom type schema are below:

```javascript
// gatsby-config.js
const path = require('path');
const linkResolver = require('./src/utils/linkResolver');

console.log(`Running in the ${process.env.NODE_ENV} environment.`);

require('dotenv').config({
  path: `.env.${process.env.NODE_ENV}`,
});

module.exports = {
  siteMetadata: { ... },
  flags: { PRESERVE_WEBPACK_CACHE: true },
  plugins: [
    `gatsby-plugin-sass`,
    `gatsby-plugin-react-helmet`,
    `gatsby-plugin-image`,
    {
      resolve: `gatsby-plugin-ts`,
      options: {
        fileName: `types/graphql.ts`,
        documentPaths: ['./src/ **/*.{ts,tsx}', './.cache/fragments/*.js', './node_modules/gatsby-*/** /*.js'],
      },
    },
    {
      resolve: `gatsby-source-prismic`,
      options: {
        repositoryName: 'pleasedonttrip',
        accessToken: `${process.env.PRISMIC_API_KEY}`,
        linkResolver: ({ node, key, value }) => linkResolver,
        schemas: {
          front_page: require('./prismic_schemas/front_page.json'),
        },
      },
    },
    {
      resolve: `gatsby-plugin-root-import`,
      options: {
        src: path.join(__dirname, 'src'),
        components: path.join(__dirname, 'src/components'),
        pages: path.join(__dirname, 'src/pages'),
        images: path.join(__dirname, 'src/images'),
        styles: path.join(__dirname, 'src/styles'),
        utils: path.join(__dirname, 'src/utils'),
        types: path.join(__dirname, 'types'),
      },
    },
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        name: `images`,
        path: `${__dirname}/src/images`,
      },
    },
    `gatsby-transformer-sharp`,
    `gatsby-plugin-sharp`,
    {
      resolve: `gatsby-plugin-manifest`,
      options: {
        name: `gatsby-starter-default`,
        short_name: `starter`,
        start_url: `/`,
        background_color: `#663399`,
        theme_color: `#663399`,
        display: `minimal-ui`,
        icon: `src/images/gatsby-icon.png`,
      },
    },
  ],
};

```

```javascript
// front_page.json
{
  "Main" : {
    "lineup_image_desktop" : {
      "type" : "Image",
      "config" : {
        "constraint" : {
          "width" : null,
          "height" : null
        },
        "thumbnails" : [],
        "label" : "Lineup Image Desktop"
      }
    },
    "lineup_image_tablet" : {
      "type" : "Image",
      "config" : {
        "constraint" : { },
        "thumbnails" : [],
        "label" : "Lineup Image Tablet"
      }
    },
    "lineup_image_mobile" : {
      "type" : "Image",
      "config" : {
        "constraint" : { },
        "thumbnails" : [],
        "label" : "Lineup Image Mobile"
      }
    },
    "hide_countdown" : {
      "type" : "Boolean",
      "config" : {
        "placeholder_false" : "show",
        "placeholder_true" : "hide",
        "default_value" : false,
        "label" : "Hide Countdown"
      }
    },
    "countdown_date" : {
      "type" : "Timestamp",
      "config" : {
        "label" : "Countdown Date"
      }
    },
    "tickets_title" : {
      "type" : "StructuredText",
      "config" : {
        "single" : "heading2",
        "label" : "Tickets Title",
        "placeholder" : "Tickets"
      }
    },
    "ticket_purchase_link" : {
      "type" : "Link",
      "config" : {
        "allowTargetBlank" : true,
        "label" : "Ticket Purchase Link",
        "select" : null
      }
    },
    "event_dates" : {
      "type" : "StructuredText",
      "config" : {
        "single" : "heading2",
        "label" : "Event Dates",
        "placeholder" : "June 11 - 14"
      }
    },
    "event_synopsis" : {
      "type" : "Group",
      "config" : {
        "fields" : {
          "synopsis_block_title" : {
            "type" : "StructuredText",
            "config" : {
              "single" : "heading3",
              "label" : "Synopsis Block Title",
              "placeholder" : "Wellness"
            }
          },
          "synopsis_block_text" : {
            "type" : "StructuredText",
            "config" : {
              "single" : "preformatted,strong,em,hyperlink,embed,list-item,o-list-item",
              "allowTargetBlank" : true,
              "label" : "Synopsis Block Text",
              "placeholder" : "Balance your body & soul with daily yoga..."
            }
          }
        },
        "label" : "Event Synopsis"
      }
    },
    "promo_video" : {
      "type" : "Embed",
      "config" : {
        "label" : "Promo Video",
        "placeholder" : "youtube.com/watch?"
      }
    },
    "info_title" : {
      "type" : "StructuredText",
      "config" : {
        "single" : "heading2",
        "label" : "Info Title",
        "placeholder" : "Info"
      }
    },
    "info_text" : {
      "type" : "StructuredText",
      "config" : {
        "multi" : "paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl",
        "allowTargetBlank" : true,
        "label" : "Info Text"
      }
    },
    "faqs_title" : {
      "type" : "StructuredText",
      "config" : {
        "single" : "heading2",
        "label" : "FAQS Title",
        "placeholder" : "FAQS"
      }
    },
    "faqs_text" : {
      "type" : "StructuredText",
      "config" : {
        "multi" : "paragraph,preformatted,heading1,heading2,heading3,heading4,heading5,heading6,strong,em,hyperlink,image,embed,list-item,o-list-item,rtl",
        "allowTargetBlank" : true,
        "label" : "FAQS Text"
      }
    },
    "footer_quote" : {
      "type" : "StructuredText",
      "config" : {
        "single" : "heading4",
        "label" : "Footer Quote",
        "placeholder" : "We can never obtain peace..."
      }
    },
    "footer_quote_background" : {
      "type" : "Image",
      "config" : {
        "constraint" : { },
        "thumbnails" : [],
        "label" : "Footer Quote Background"
      }
    }
  }
}

```

---

<div class="post-metadata">

**Author:** ![Pau](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/pau/32/5422_2.png) [@Pau](https://community.prismic.io/u/Pau)\
**Post date:** [July 29, 2021, 12:28am UTC](https://community.prismic.io/t/error-building-with-gatsby-source-prismic-in-the-sourcenodes-lifecycle/6419/3 "2021-07-29T00:28:29Z")

</div>

Hello, have you tried upgrading your dependencies. We have a guide that explains how to update the gatsby-source-prismic plugin from version 3 to version 4.

> **[Gatsby Migration Guide: gatsby-source-prismic V3 to V4](https://prismic.io/docs/technologies/gatsby-source-prismic-v3-to-v4)**
>
> Upgrade the gatsby-source-prismic plugin from version V3 to V4 on your Gatsby project.

---

<div class="post-metadata">

**Author:** ![dune.architect](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/dune.architect/32/2645_2.png) [@dune.architect](https://community.prismic.io/u/dune.architect)\
**Post date:** [July 29, 2021, 6:51pm UTC](https://community.prismic.io/t/error-building-with-gatsby-source-prismic-in-the-sourcenodes-lifecycle/6419/4 "2021-07-29T18:51:38Z")

</div>

Thank you @Pau , that solved my issue. I'm not sure how I installed the previous version

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [July 30, 2021, 6:52pm UTC](https://community.prismic.io/t/error-building-with-gatsby-source-prismic-in-the-sourcenodes-lifecycle/6419/5 "2021-07-30T18:52:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/system/32/1746_2.png) [@system](https://community.prismic.io/u/system)\
**Post date:** [December 9, 2021, 3:33pm UTC](https://community.prismic.io/t/error-building-with-gatsby-source-prismic-in-the-sourcenodes-lifecycle/6419/6 "2021-12-09T15:33:26Z")

</div>


