styxlab / gatsby-theme-try-ghost

A Gatsby theme to build flaring fast blogs from headless Ghost CMS
MIT License
136 stars 56 forks source link

gatsby build issue and `gatsby-rehype-ghost-links` #281

Closed sawilde closed 3 years ago

sawilde commented 3 years ago

I've been upgrading from gatsby v2 to v3 and I have hit the following issue when I run gatsby build

"gatsby-theme-try-ghost" threw an error while running the createPages lifecycle:

The "url" argument must be of type string. Received undefined

GraphQL request:223:21
222 |                 childHtmlRehype {
223 |                     html
    |                     ^
224 |                     htmlAst,The "url" argument must be of type string. Received undefined

GraphQL request:224:21
223 |                     html
224 |                     htmlAst
    |                     ^
225 |                     tableOfContents,The "url" argument must be of type string. Received undefined

GraphQL request:225:21
224 |                     htmlAst
225 |                     tableOfContents
    |                     ^
226 |                 }

  203 |     // Check for any errors
  204 |     if (result.errors) {
> 205 |         throw new Error(result.errors)
      |               ^
  206 |     }
  207 |     log(`GraphQL data sucessfully fetched`)
  208 |

I haven't been able to determine what the exact issue is but I do know that if I remove the gatsby-rehype-ghost-links from gatsby-config.js the site builds and appears to be working fine. I am concerned, however, that an issue with URLs that this transform is trying to resolve could raise unexpectedly.

Any hints?

styxlab commented 3 years ago

@sawilde Could you please link to a repo that I can clone and where this issue appears after running gatsby build? I am not able to reproduce this issue with the current version of gatsby-theme-try-ghost.

sawilde commented 3 years ago

I can't repeat it either using the current version - only on my blog site (private repo I am afraid)

I may look to rebuild it from scratch based on the latest and greatest rather than hop the upgrade behaved properly

styxlab commented 3 years ago

I will close this for now as I consider this to be fixed in the latest version of this repo.