Preview Exit does not work in Preview ToolBar

Hi,

Sorry seems like lot of people having the same issue. I read through few post but still can not find out the solution.

I have a project which has

next.js 9.2
prismic-javascript: 2.7.1
prismic tools bar: https://static.cdn.prismic.io/prismic.min.js?repo=clientreponam&new=true

So no next js preview support. Preview works fine but when I click on close button from toolbar. it just refreshes the page and can not exit the preview.

My preview URL is /preview. And using below code to generate the preview.

const url = await Client(req).previewSession(token, linkResolver, '/');
if (res) {
res.writeHead(302, {
Location: url,
});
res.end();

I feel like it use to work and suddenly its stop working now.

I have checked our few other projects based on react-create-app.
Preview exit stop working there as well

Hey Tejas,

Thanks for posting! Are you using Google Chrome? A few weeks ago Chrome updated how they handled samesite cookies , which created errors with previews. If you are using Chrome, could you try previewing in Firefox and see if that makes a difference?

Sam

I have tried in Firefox and it works. But it does not work in Chrome. Is there any fix for this.

Regards

@samlittlefair

I see that you guys working on solution already and following issue on Can't close the Preview module (Chrome)

I will follow the thread and wait for notification. Thanks for your time.