commercetools / commercetools-docs-kit

Tools and components for developing Documentation websites 🛠
https://docs-kit.commercetools.vercel.app
MIT License
18 stars 5 forks source link

(waiting for gatsbyJs) Error messages when used in other repository #448

Open nkuehn opened 4 years ago

nkuehn commented 4 years ago

When used in the internal docs repository, every develop or build process logs the following error:

warn The GraphQL query in the non-page component "/Users/aoluyinka/commercetools/commercetools-docs/node_modules/@commercetools-docs/gatsby-theme-docs/src/templates/release-notes-detail.js" will not be run.
warn The GraphQL query in the non-page component "/Users/aoluyinka/commercetools/commercetools-docs/node_modules/@commercetools-docs/gatsby-theme-docs/src/templates/release-notes-list.js" will not be run.
Exported queries are only executed for Page components. It's possible you're
trying to create pages in your gatsby-node.js and that's failing for some
reason.

If the failing component(s) is a regular component and not intended to be a page
component, you generally want to use a <StaticQuery> (https://gatsbyjs.org/docs/static-query)
instead of exporting a page query.

If you're more experienced with GraphQL, you can also export GraphQL
fragments from components and compose the fragments in the Page component
query and pass data down into the child component — https://graphql.org/learn/queries/#fragments
davifantasia commented 4 years ago

I'll leave this comment for prospective further discussions while I try to find a solution.

Cause of Problem

Some templates are unused by some of our micro-sites, which somehow tricks Gatsby into thinking unused templates must be non-page components.

State of the Problem

This is a problem from Gatsby of which no official solution exists yet - https://github.com/gatsbyjs/gatsby/issues/20413.

update: new tracker issue on Gatsby side: https://github.com/gatsbyjs/gatsby/issues/23729

nkuehn commented 4 years ago

Thanks for the analyis! I take it out of the production ready requirements and labeled it on hold as a tracker.