gatsby-source-prismic-graphql
gatsby-source-prismic-graphql copied to clipboard
GraphQLError: Syntax Error: Invalid number, expected digit but got: "p".
Hi,
How can I enable verbose mode to debug this error?
success building schema - 0.307s
ERROR #11321 PLUGIN
"gatsby-source-prismic-graphql" threw an error while running the createPages lifecycle:
Syntax Error: Invalid number, expected digit but got: "p".
GraphQLError: Syntax Error: Invalid number, expected digit but got: "p".
failed createPages - 0.518s
Best regards, Stéphane
This is my bug:
- in
gatsby-config.js
:
pages: [{ // (optional, builds pages dynamically)
type: 'content-page-1', // TypeName from prismic
match: '/article/:uuid', // Pages will be generated under this pattern
path: '/article', // Placeholder page for unpublished documents
component: require.resolve('./src/templates/ArticlePageTemplate.js')
}]
fixed version:
pages: [{ // (optional, builds pages dynamically)
type: 'ContentPage1', // TypeName from prismic
match: '/article/:uuid', // Pages will be generated under this pattern
path: '/article', // Placeholder page for unpublished documents
component: require.resolve('./src/templates/ArticlePageTemplate.js')
}]
The bug was type: 'content-page-1'
instead of type: 'ContentPage1'
.
Question: it's is possible to add a type
value checking in the code? and display one error message if type value is not found or invalid?
Best regards, Stéphane
It might not solve the problem but I notice you are using :uuid
, im using :uid
wondered if there was any reason you are using it like this?
@jodiedoubleday thanks, yes, it is a mistake 👍. But not the bug of this issue.