marguerrrite / gatsby-prismic-starter-prist

Gatsby starter for portfolios and blogs using Prismic CMS
MIT License
344 stars 70 forks source link

Loading (Static Query) issue #21

Closed mcclntck closed 4 years ago

mcclntck commented 4 years ago

Hey guys, I'm hitting an issue when trying to view my site. I got it working previously, but something changed and now the site just says Loading (Static Query)

I'm not sure what I did, but can see this https://github.com/gatsbyjs/gatsby/issues/6350 has already been raised here.

What do I need to do to get this working again?

Thanks

mcclntck commented 4 years ago

I fixed this by removing the StaticQuery and reverting to this.

const Layout = ({ children }) => (
    <LayoutContainer className="div">
                <Global styles={[globalStyles, typeStyles]} />
                <div className="Layout">
                    <Header />
                    <main className="Layout__content">
                        {children}
                    </main>
                    <Footer />
                </div>
            </LayoutContainer>
)

export const query = graphql`
        query SiteTitleQuery {
            site {
                siteMetadata {
                    title
                }
            }
        }
    `

Not sure what else there was to do, but it got it working.

trybick commented 4 years ago

This saved me, thanks!

Also I can confirm this error happened to me too on first project start. Using the code above fixes it.

k-hud commented 4 years ago

Amazing @mcclntck. That did it. 🙌