Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Can't get previews working #219

Open
miraclemaker opened this issue Jun 2, 2020 · 5 comments
Open

Can't get previews working #219

miraclemaker opened this issue Jun 2, 2020 · 5 comments

Comments

@miraclemaker
Copy link

I've set up preview url in Prismic. Used the same path for 'link resolver' as the preview path in my gatsby-config.js

When I try and preview it opens up the site ok, then I can see a 401 request to https://xxxxx.cdn.prismic.io/api/v2 with the response:

{"error":"Invalid access token","oauth_initiate":"https://xxxx.cdn.prismic.io/auth","oauth_token":"https://xxxx.cdn.prismic.io/auth/token"}

The page itself is blank with a purple box bottom left. The purple box has the correct (updated) title of the page being previewed.

@fitzgers
Copy link

fitzgers commented Jun 4, 2020

I have been having the same problem for some time now. I was finally able to get it to work on localhost by changing the Prismic API settings to Open, but still no luck on the hosted version of the site.

@miraclemaker
Copy link
Author

Thanks for the response. I tried changing my API settings to open from private. I can see the request to https://xxxxx.cdn.prismic.io/api/v2 is getting a response now, but the page is still blank. There's no output in the console to give an indication of what is going wrong.

@miraclemaker
Copy link
Author

If I take the preview URL and alter it for localhost it does load the page, but it's the original version not the updated version I wanted to preview. It still has the purple box at the bottom left.

@fitzgers
Copy link

fitzgers commented Jun 8, 2020

@birkir @riywo @veloce and team , any chance we can get some feedback or help on this one? I've chatted with Phil at Prismic extensively on this, and his last response to me was this:

The team had a look and the thing is that the query when doing a preview and calling the API is not passing the token. We don't know why. This looks like an issue in the plugin, so we'd recommend creating the issue directly in the plugin at the moment

Any attention and/or feedback you can provide on this one would be much appreciated!

@ohlr
Copy link

ohlr commented Jul 7, 2020

Duplicate of #45

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants