-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
After updating to gatsby-source-sanity v7.9.0, node started throwing an obscure error right after Gatsby's onPreInit hook:
success onPreInit - 0.003s
info [sanity] Fetching remote GraphQL schema
error Cannot read properties of undefined (reading 'split')
I was eventually able to figure out that it was because apiHost was reading as undefined in the Sanity config. I didn't see anything in the documentation saying this needed to be provided in gatsby-config.js, but after adding it everything ran fine:
{
resolve: 'gatsby-source-sanity',
options: {
...
apiHost: 'https://api.sanity.io',
....
},
},
}
I was also able to replicate this issue by starting a new gatsby project using Sanity as a source.
Node Version: v18.12.1
Metadata
Metadata
Assignees
Labels
No labels