birkir / gatsby-source-prismic-graphql

Gatsby source plugin for Prismic GraphQL
MIT License
137 stars 75 forks source link

broken only on production #147

Closed deebov closed 4 years ago

deebov commented 4 years ago

hey there I've been stuck on this issue for a while now. Everything is perfect on development. But on production links and images aren't working correctly. it reloads the page when clicking on any link. I see this error in the console: image

I tried to upgrade to beta and canary. none of them has helped. I noticed that when I switched from 3.3.1 to beta and canary I started to see the error above instead of Uncaught TypeError: Cannot set property 'query' of undefined

Steps to reproduce:

  1. gatsby new gatsby-starter-blog https://github.com/gatsbyjs/gatsby-starter-blog
  2. cd gatsby-starter-blog
  3. yarn add gatsby-source-prismic-graphql
  4. add this code below to the plugins array in gatsby-config.js
    {
      resolve: "gatsby-source-prismic-graphql",
      options: {
        repositoryName: "your-repo",
        accessToken:
          "your-access-token",
      },
    },
  5. And voila! your app is automatically broken even though you haven't changed anything in the src folder
deebov commented 4 years ago

@birkir do you have any idea what might be causing the issue?

aodysseos commented 4 years ago

Have you seen this: https://github.com/birkir/gatsby-source-prismic-graphql/issues/77

deebov commented 4 years ago

Have you seen this: #77

Thank you. It fixed the issue