-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Closed
Description
When a top-level Contentful resource queried for in gatsby-node.js (used to call createPage) is deleted from Contentful and gatsby develop is restarted, the following error is thrown:
success onPreBootstrap — 0.153 s
⠁ Starting to fetch data from Contentful
Fetching default locale
⠐ source and transform nodesdefault local is : en-US
⠈ source and transform nodescontentTypes fetched 17
error Plugin gatsby-source-contentful returned an error
TypeError: getNode is not a function
- gatsby-node.js:90
[project]/[gatsby-source-contentful]/gatsby-node.js:90:37
- Array.forEach
- gatsby-node.js:89 _callee$
[project]/[gatsby-source-contentful]/gatsby-node.js:89:16
- next_tick.js:112 process._tickCallback
internal/process/next_tick.js:112:11
⠠ source and transform nodes
This corresponds with these lines of the gatsby-source-contentful plugin:
currentSyncData.deletedEntries.map(function (e) {
return e.sys.id;
}).forEach(function (id) {
return deleteNode(id, getNode(id)); // This is line 90 that's throwing the error
});I was able to resolve the issue by removing the .cache folder and restarting. I don't know what's “upstream” of this sourceNodes call to investigate what boundActionCreators.getNode is.
It looks like this also happened to @johndewolf a few weeks ago when editing Contentful content: #4401 (comment)
Environment
- Gatsby version (
npm list gatsby): 1.9.243 - gatsby-cli version (
gatsby --version): 1.1.50 - Node.js version: 9.9.0
- Operating System: macOS High Sierra 10.13.3
Metadata
Metadata
Assignees
Labels
No labels