prismicio / gatsby-source-prismic-graphql

Gatsby source plugin for Prismic GraphQL
MIT License
17 stars 14 forks source link

preview not working correctly : × Unhandled Rejection (TypeError): Cannot read property 'options' of undefined #48

Closed GreatState closed 4 years ago

GreatState commented 4 years ago

Have set up a new site with prismic but getting the following error

image

I've traced it to the this.props.prismic.options;

in PreviewPage.js

For some reason i'm not getting prismic being added to props?

For info i've set up another site using bikir's version:


    "gatsby-source-prismic-graphql": "^3.3.0",
  "gatsby": "2.7.5",

and this worked fine

  System:
    OS: macOS Mojave 10.14.6
    CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 12.16.3 - ~/.nvm/versions/node/v12.16.3/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.4 - ~/.nvm/versions/node/v12.16.3/bin/npm
  Languages:
    Python: 2.7.16 - /usr/bin/python
  Browsers:
    Chrome: 85.0.4183.83
    Firefox: 79.0
    Safari: 13.1.2
  npmPackages:
    gatsby: ^2.24.37 => 2.24.42 
    gatsby-image: ^2.4.14 => 2.4.15 
    gatsby-plugin-eslint: ^2.0.8 => 2.0.8 
    gatsby-plugin-layout: ^1.3.10 => 1.3.10 
    gatsby-plugin-manifest: ^2.4.22 => 2.4.22 
    gatsby-plugin-offline: ^3.2.22 => 3.2.23 
    gatsby-plugin-react-helmet: ^3.3.10 => 3.3.10 
    gatsby-plugin-react-svg: ^3.0.0 => 3.0.0 
    gatsby-plugin-sharp: ^2.6.25 => 2.6.26 
    gatsby-plugin-styled-components: ^3.3.10 => 3.3.10 
    gatsby-plugin-typescript: ^2.4.18 => 2.4.18 
    gatsby-source-filesystem: ^2.3.24 => 2.3.24 
    gatsby-transformer-sharp: ^2.5.12 => 2.5.12 
  npmGlobalPackages:
    gatsby-cli: 2.12.82
GreatState commented 4 years ago

I have fixed this by moving this config option to the first option in the plugins array