DEV Community

Cover image for πŸ€¦β€β™‚οΈ Weekly fail (37/2020)
Ondrej Polesny for Kontent.ai

Posted on

3

πŸ€¦β€β™‚οΈ Weekly fail (37/2020)

Last week I was converting a Gatsby Lumen starter website to Gridsome and got stuck on an error
Error: Cannot get field 'id' from type 'Page'. Field does not exist.

The error occurred only in case a certain page was published in the headless CMS Kentico Kontent and it was happening in the GraphQL schema generation. So it was quite difficult to debug.

I tried the try/fail method of debugging only to find out you can't use "Page" as a type name for your nodes. Not sure what the reason is as I was not willing to keep digging after several hours of nail-biting.

Lesson learned: Sometimes the tools we use don't have everything documented. If you're experiencing the above error, add a prefix to content item types in the configuration of the Gridsome Kontent plugin:

options: {
  ...
  contentItemConfig: {
    contentItemTypeNamePrefix: '_',
    ...
  }
}
Enter fullscreen mode Exit fullscreen mode

Sentry image

See why 4M developers consider Sentry, β€œnot bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Heroku

This site is powered by Heroku

Heroku was created by developers, for developers. Get started today and find out why Heroku has been the platform of choice for brands like DEV for over a decade.

Sign Up