Prismic preview links not working -- Cookie not being set -- Request for better docs

Hi!

My technology is set up to read from the io.prismic.preview cookie and pass this to the Prismic-Ref when making a GraphQL request. This has been working wonderfully for me and my client. However, it seems to have recently stopped working! Here's the steps to reproduce.

Steps to Reproduce:

  1. Visit prismic.io Preview
  2. In the console run "document.cookie"

Expected

io.prismic.preview={...

Actual

Empty

If I click "Planned" then choose a release and click "Preview on Production" it does work.

As a side note:

I feel like there's been a move in Prismic recently to dumb down the documentation and direct people to the maintained projects to handle the heavy lifting. I want to say that, as a developer, I deeply disagree with this ethos.

The Vanilla JS docs say that you should use one of the frameworks. And I don't see any docs anymore that explains how the preview cookie is set, or how setting Prismic-Ref controls the response in GraphQL.

As a developer, I'd like to know how things work on a low level so I can build my own. I don't want to use any of your frontend codebases. Users should have all the tools freely available to build their own frontend tech.

This takes some of the responsibility off of the Prismic dev team if people can build their own integrations as well.

For example, I'm building a Rails project that integrates with Prismic, and I ended up building all my own renderers because the prismic/rails project is outdated and too opinionated. I'm happy to share this with the community! But it's impossible for me to maintain a project like this if you hide these details about how the product works from your technically advanced users.

Please bring back the docs that explain how the io.prismic.preview cookie is set and how the Prismic-Ref is set in GraphQL. Share low-level details about what Prismic is expecting from a link-resolver so that people can build their own. My clients and I can't use a static site generator because we need login abilities! So all your Hugo, Nuxt, etc doesn't work for us at all.

Thank you!

1 Like

Hello @lpender

Welcome to the Prismic community and thanks for reaching out to us.

Have you tried to clear cookies in the browser and try again?

I appreciate your feedback and taking it into account. I'll pass this to my team for further improvements to the document.

Thanks,
Priyanka

Hi,

Thanks for the suggestion! Clearing the cookies doesn't work.

Here is a fuller report which I think should demonstrate clearly that the issue is with Prismic.

Steps to Reproduce

Expected Result

  • Should see the widget telling us we are in the release "Test"

Actual Result

  • We do not see this widget

Hello @lpender

I need to debug the code. Could you please share your project source code with me? You can send it in a private message, though.

Thanks,
Priyanka

Hi, figured it out.

The 404 page renders without the application layout.

Because of this it doesn't include the Prismic JS Preview widget.

Adding the Prismic JS Preview widget to the 404 page fixes the issue.

    <script async defer src="https://static.cdn.prismic.io/prismic.js?new=true&repo=myrepo" ></script>

It still briefly flashes a 404, but the page reloads and the content is visible.

Thanks