Build Error - "Field does not exist" - 'keywords' in WordPressAttachment_MediaDetails
See original GitHub issueDescription
I’ve been working on a website using the WordPress data source for a couple months. Today, the build process to Netlify encountered an error. In the past I’ve been able to debug these errors, because they’ve been due to something on my end. This seems different.
I reverted the change I made between the previous build and this one, and the same error occurred.
I updated WordPress core on the source URL this afternoon, so that might have something to do with it.
Below is the error from the Netlify console:
2:16:21 PM: Error: Cannot get field 'keywords' from type 'WordPressAttachment_MediaDetails_ImageMeta'. Field does not exist.
2:16:21 PM: at ObjectTypeComposer.getField (/opt/build/repo/node_modules/graphql-compose/lib/ObjectTypeComposer.js:167:13)
2:16:21 PM: at ObjectTypeComposer.getFieldExtensions (/opt/build/repo/node_modules/graphql-compose/lib/ObjectTypeComposer.js:976:24)
2:16:21 PM: at ObjectTypeComposer.extendFieldExtensions (/opt/build/repo/node_modules/graphql-compose/lib/ObjectTypeComposer.js:989:26)
2:16:21 PM: at addFieldExtensions (/opt/build/repo/node_modules/gridsome/lib/graphql/nodes/index.js:153:25)
2:16:21 PM: at addFieldExtensions (/opt/build/repo/node_modules/gridsome/lib/graphql/nodes/index.js:156:9)
2:16:21 PM: at addInferredFields (/opt/build/repo/node_modules/gridsome/lib/graphql/nodes/index.js:141:9)
2:16:21 PM: at createFields (/opt/build/repo/node_modules/gridsome/lib/graphql/nodes/index.js:113:3)
2:16:21 PM: at createNodesSchema (/opt/build/repo/node_modules/gridsome/lib/graphql/nodes/index.js:30:5)
2:16:21 PM: at createSchema (/opt/build/repo/node_modules/gridsome/lib/graphql/createSchema.js:60:3)
2:16:21 PM: at Schema.buildSchema (/opt/build/repo/node_modules/gridsome/lib/app/Schema.js:28:28)
2:16:21 PM: at Plugins.createSchema (/opt/build/repo/node_modules/gridsome/lib/app/Plugins.js:94:22)
2:16:21 PM: at process._tickCallback (internal/process/next_tick.js:68:7)
Steps to reproduce
Running gridsome build
on a project using WordPress as the data source might work, presumably on a WordPress site with the most recent version of WordPress, 5.2.3.
Expected result
The build normally succeeds without any issues
Actual result
The build failed, attempting to get the ‘keywords’ endpoint from WordPressAttachment_MediaDetails_ImageMeta
N.B. I’m not accessing that endpoint anywhere in the project. The only endpoints I’m accessing for WordPressAttachment_MediaDetails are: width height
Environment
Libs:
- gridsome version: 0.7.6
- @gridsome/cli version: 0.2.1
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (8 by maintainers)
Top GitHub Comments
@hacknug It seems like the WordPress plugin creates a reference to a post type that hasn’t been fetched. You can try to enable the
DlmDownload
post type for the REST API in WordPress. But I’ll take a look at how it was handled in earlier versions.The fix is in these lines. The other changes in the commit are mostly tests to ensure this doesn’t happen again 😃