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:
"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:
// 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`,
},
},
],
};
// 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"
}
}
}
}