Preview mode hangs/timing out (preview token expires?)

Good day,

We have a known issue with Prismic's preview that we can't wrap our head around.

I've opened an issue here: Preview mode timing out (UnhandledPromiseRejectionWarning) · Issue #132 · prismicio/prismic-javascript · GitHub — Alas no solution so far.

I'm not sure if this is a JS (frontend) or Node (backend) problem (we use Express), but it seems that when a preview token expires (let say I was in preview mode and comeback a week later on our website), the site hangs indefinitely. The solution so far is to ask my team to clear the "Application data" in Chrome, which I think clear the expired preview token.

In the GitHub issue I pasted all the code related to this, let me know if you need anything else on my end.

Here's the error report in Sentry:

Thank you!

Hey @allaire,

Welcome to the Prismic Community Forum. Thanks for posting this question. I've submitted a request to our dev team to look into it. I'll let you know what happens next.

Sam

1 Like

Any update @samlittlefair ?

Thank you

Hey @allaire,

Thanks for checking in. I've spoken to our dev team about this, and they're looking into it. If I don't hear anything back from them this week, I'll follow up on Monday and let you know what they say :slight_smile:

Sam

1 Like

Good day. This issue is still causing trouble to my team and as a paying user, I'm disappointed by the lack of support this is receiving. I'm willing to share whatever is missing to help you debug this.

Hi @allaire ,

Sorry for the silence on my end. I've been going back and forth with the dev team on this.

Can you explain a little more about the context of the issue, so I understand better?

Usually, a user would launch a preview from the editor, and close that preview when they're done. A week later, they might launch another preview from the editor. It sounds like you're describing a different workflow. Can you clarify for me?

Sam

An editor launch a preview, then start editing while previewing in real time. He never presses the "X" in the widget at the bottom. He might (or not) publish the article he was previewing at some point. The editor's browser is never closed (so the preview session cookie isn't cleared). At some point, when the editor tries to access the site again (this could be a couple days later), the site hangs and returns the error highlighted in my post. It looks like the preview token is expired and the error is never caught by Prismic, so the site just hangs. The workaround is to wait for NGINX to timeout, then go in "Application Data" and clear all website's cookies.

@allaire Thanks for the clarification. And what's your tech stack?

Simple Node + Express stack, more here: Preview mode timing out (UnhandledPromiseRejectionWarning) · Issue #132 · prismicio/prismic-javascript · GitHub

@allaire Thank you for the extra info! I've gone back to my dev team with it, and I'll let you know what I hear back. I'm out of the office on Friday, but we've got a sync scheduled for Monday, so I'll check on the progress then and get back to you the same day.

Sam

Hey @allaire, Just an update that I don't have any more info yet, but I'll be sure to let you know tomorrow.

Hey @allaire ,

I've talked to the dev team about this, and they've added the issue to their tracker. I can't say when they'll address it, but I'll let you know if there's any movement! In the meantime, let me know if you want to talk about other ideas for workarounds.

Best,
Sam

Thanks Sam, let's follow up in a couple months :wink:

Have a good day!

Math

1 Like

We're tracking this issue.