My preview work, but my toolbar errors out and I can't find what's the error. Just the other day I integrated a Preview for another client (who doesn't have accessToken) and it worked great. Now I'm integrating the Preview for existing Prismic website (but migrating to another framework) and they have an accessToken, but I get the following error when trying to implement it. From what I can see, the only difference between the two is that the latter has an accessToken
Failed to load resource: the server responded with a status of 404 ()
iframe.html:1 Uncaught (in promise) SyntaxError: Unexpected token < in JSON at position 0
My preview toolbar script is in _document.tsx as described in the documentation
Yes, as per docs - I have loaded it in _document.js
The troubleshooting article was not helpful unfortunately. Any advise to how to get this going will be much appreciated!
I've tried opening a preview link in Chrome, Opera & Safari but the error message was the same.
The interesting thing is that I worked on another client's project with a similar setup, and it worked flawlessly. The main differences with this project is
already existing project
has accessToken
Let me just saw again that the preview function is working - the problem is that the toolbar errors out
Hi @Pau - any updates on this? My preview iframe still errors out and I can't quite figure it out. Repo name is kontist-demo - it works for the existing website (built in svelte) but it errors out in the nextjs website we are building
Unfortunately the problem appeared all of the sudden once again.
This is what happens once I preview unpublished documents or documents which have new changes (but not yet published).
As before, the preview works and I can see the unpublished changes in my browser. However the toolbar doesn't show up and I get these errors in the console.
A note worth noting is that if I preview a document with no changes (so identical to production), there are no errors and I see the toolbar successfully.
Something weird is going on, but I can't figure it out. Any help will be greatly appreciated
@Phil@Pau Apologies for pinging you again, but do you have any updates regarding this issue? This is a blocker for my client as they are looking to launching soon but Preview is quite important feature for them
Once I tried from the settings type I started to see the 500 error and the toolbar failed to load, although the toolbar loaded the second time around. The 500 error then began appearing on the pricing taxes Custom Type.
The big thing that also stood out to me was the cross-origin error which could be causing all of this as the cookie and toolbar are coming from Prismic and the project might be blocking them.
Thanks a lot looking into this. I didn't notice the cross-origin frame error (how do I recreate it?). Hopefully the internal team will be able to investigate and get to the bottom of it.
OK, thanks for the extra info. I found some errors related to this in the logs and passed the issue to the dev team. Hopefully they'll have some time to look in to this soon.