Can't close the Preview module (Chrome)

I have the same bug here.

I am using gatsby and prismic and the preview never closes, whenever I hit the cross icon the page reloads with the preview system.

Hi Tim,

You’re not the first person to report this, but I’m not sure what the issue is so I’m going to report this to the dev team to find out more.

Thanks.

@mgilbride @tim2 Can you tell me what browser you’re using? I think this might be a Chrome specific issue.

Yep - you’re right! I was using chrome, and don’t see the issue on firefox.

@Phil - is there any way to include the prismic toolbar as part of our projects? If so is this documented somewhere?

I see the description on the @prismicio/prismic-toolbar project on Github: “Isn’t anymore on npm. Include script static.cdn.prismic.io/prismic.min.js instead”.

This is…not ideal. I think I speak for all developers when I say that I would prefer to have control over the version of the toolbar myself, rather than have Prismic introduce breaking changes that I can’t prevent.

I think this is a breaking change from Chrome’s samesite cookies update that they have introduced, so having the toolbar in your project probably won’t solve the issue.

Also I don’t believe the team have made any changes to the toolbar recently.

Once I’ve got more information from the team I’ll update you here.

Ahh ok. That’s a fair response @Phil.

While in this case the issue isn’t due to a change by the Prismic team, I would strongly encourage providing your customers with a way to version the toolbar. Maybe via some parameter on the script to indicate which version of the toolbar is being fetched?

Just a suggestion…thanks for the quick replies as always : )

Hi Matt,

I agree I think it might be useful to allow some user controlled versioning of the toolbar, though I’m sure there was a practical reason for the change. I’ll get more information from the team as to why they made that decision and let you know.

Also and update on the issue: The team has merged a fix and we’re are just waiting to deploy, once this is done I’ll update you her.

Thanks.

Hi @tim2 & @mgilbride, the Product team here has deployed the fix for the Prismic toolbar. You might need to clear your cache and reload, but then you should be able to close the preview session :slight_smile:

1 Like

Hi @waihon,

Can you check to make sure everything has cleared correctly and that your are getting the correct version of the toolbar. You can do that by typing prismic.version in your browser console for you website like so:

The version should be 4.0.0, like above.

Thanks.

I am currently using static.cdn.prismic.io/prismic.min.js without the new=true query parameter.

The version is still 1.3.x - the library I am using is appending the non-new version

is there a way I can resolve this?

I quickly checked your repo settings and you have the correct version of the toolbar activated for your account, you should be able to call it with the script which is suggested in your preview settings.

Which library and technology are you building your website with?

I am still using the 'deprecated' gatsby prismic source graphql lib, and looking through the library, they seem to use /static.cdn.prismic.io/prismic.min.js (without query parameter new=true)

Unfortunately there is not much I can do on my side for that then, sorry. I would recommend creating an issue in the github repo for this to bring it to their attention.

This issue has been closed as it has been fixed, Flag if it is not the case for you to reopen.