From what I am assuming this url for example in the screenshot should allow anyone to preview the unpublished content. In this case I'm trying to share unpublished blog posts that are part of a release. Screenshot:
Hello Niki, thank you for reaching out. This is a known issue we're aware of and already tracking.
We will work on making enhancements to the preview functionality with Next.js in the future, but without a rough ETA for the moment. So, unfortunately there's still no workaround to make the sharable link work. As soon as we make progress or have any news about this we'll let everyone know in this same thread.
@Pau It might be good to disable the display of the link if its known that this feature is broken. I did a product demo to my whole team and it was frustrating that it did not work. The preview functionality without building is one of the reasons why we are switching platforms. It would be nice if Prismic would clearly label things as "beta" if they are not ready to be used. Even if this was working at one point you should remove it.
Thank you very much for the feedback, I'll be sure to mention this to the product team.
And, whenever I have news about this issue getting fixed I'll let you know.
system
(system)
closed as resolved, flag & select 'Something Else' to reopen.
9
This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
You mentioned something about a fix related to this issue been released, but we're still experiencing it. Our previews work like a charm, except when giving a sharable link to a non prismic user. We're using Next.js too.
@jrodriguez I'm really sorry for the confusion; this issue is in work now and wasn't released.
I will let you know if I get any updates.
2 Likes
Fares
closed , flag & select 'Something Else' to reopen.
18
This thread is being monitored as an open ticket in the issue tracker. We will update this post as we get more information. If you have a similar use-case, you can ‘Flag’ this topic to reopen.
You should be able to use shareable links with Next.js if you follow the set-up here, although because of the way that Next.js's preview system works there is still an issue with shareable links for unpublished documents:
The team is working on a prismic-next plugin that should hopefully resolve this issue, it will be released in BETA in January (Fingers crossed):
Hello @phillip_pan can you describe your issue in more detail?
We haven't had any problems with shareable links lately, they should be working just fine with the new kit.
The shareable preview link is working fine when I open it up myself, but it didn't work when showing it to others. Even when sharing to Prismic users (Same Prismic repo).
Have you made sure that the toolbar script is added to every page in your application? sometimes the toolbar will show up on a certain page because there's a linked document that gets detected by the toolbar, a menu bar, or an information card, and the main page gets ignored.
@Pau I'm having the same problem. I can't use @prismic/next package just yet since the project is using client v4 and we are not yet ready to upgrade to v6.
Previews are working great and the share links are working when opening myself in the same browser. However, when I try to open them in another browser as a non logged in user, nothing happens - the page just opens with no toolbar enabled.
From the console.log, I can see the previewData is not set and it looks like the /api/preview endpoint is not hit at all (as opposed to normal Previews).
This is quite urgent as my client can't share links with colleagues, so any assistance will be greatly appreciated.
There are no errors in the console.
Looks like the main problem is that the preview link doesn't hit /preview/api which means that my Next.js app doesn't realise that it's a preview link, therefore it renders the page as normal
I just noticed that the repository has Private API access (with access token) - and that probably impacts if I can share to non-prismic users. Is there a way to share to non-prismic users while keeping it as a Private API?
Edit: I set the API to Public temporarily but this didn't fix the problem