Sveltekit project: error with slice-machine + error 500 on draft previews

Hi everyone,
I really looked everywhere before posting but I didn't find a solution to my problems.
I built a project with Prismic minimal starter kit for sveltekit and I'm hosting the project on Vercel.
My problem today is that I don't get the slices previews for a page, I first get a glimpse of it then it goes blank and at some point I get an "error" text in red.
Also when I try to preview the page i works well on published pages but not for a draft.
Maybe it's all connected... I'll continue to look for an answer and make sure to update you guys here if I found any but I also hope someone can help me with this.
Feel free to ask me if you need anything.
Thanks a lot in advance

Ok some update here:
I found out that if I empty the cache of Chrome I can then get back my slice previews on the page builder.
But when I preview the page and I come back to the page builder, then the slice previews are not working anymore.

Thanks for raising this @paul6. I'm going to try to recreate it myself.

Is there anything I should know about your implementation — any libraries or third-party integrations that you're using?

What hosting provider are you using to deploy your site?


Hi @samlittlefair and thanks for your message.

I'm using Vercel and TailwindCSS and I didn't try anything particularly complicated for this.
I just made a fork of the repo for you if you want to try it yourself (if you don't find it in the I'll be happy to help you with anything you might need):

I followed your youtube tutorial to create this website so you should feel very confortable with it :slight_smile:


Ok, I found something interesting that might help you in your investigation...
By default my browser has third-party cookies allowed and the slices previews won't work but I just switched to blocked and the slices work as intended.
I hope it helps you more than me :sweat_smile:

Hey @paul6,

Thanks for the details, and I'm glad the tutorial was (at least a little helpful)! I'll spend some time debugging this on Monday and get back to you.


1 Like

Hey @paul6,

I'm very sorry - I lost track of this thread. Are you still having this error?