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

**URL:** <https://community.prismic.io/t/sveltekit-project-error-with-slice-machine-error-500-on-draft-previews/15000>\
**Category:** Developing with Prismic\
**Tags:** svelte, slice-machine\
**Created:** [January 17, 2024, 8:29pm UTC](https://community.prismic.io/t/sveltekit-project-error-with-slice-machine-error-500-on-draft-previews/15000 "2024-01-17T20:29:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul6](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/paul6/32/5691_2.png) [@paul6](https://community.prismic.io/u/paul6)\
**Post date:** [January 17, 2024, 8:29pm UTC](https://community.prismic.io/t/sveltekit-project-error-with-slice-machine-error-500-on-draft-previews/15000/1 "2024-01-17T20:29:09Z")

</div>

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  
Paul

---

<div class="post-metadata">

**Author:** ![paul6](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/paul6/32/5691_2.png) [@paul6](https://community.prismic.io/u/paul6)\
**Post date:** [January 17, 2024, 9:32pm UTC](https://community.prismic.io/t/sveltekit-project-error-with-slice-machine-error-500-on-draft-previews/15000/2 "2024-01-17T21:32:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [January 18, 2024, 1:02pm UTC](https://community.prismic.io/t/sveltekit-project-error-with-slice-machine-error-500-on-draft-previews/15000/4 "2024-01-18T13:02:46Z")

</div>

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?

Sam

---

<div class="post-metadata">

**Author:** ![paul6](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/paul6/32/5691_2.png) [@paul6](https://community.prismic.io/u/paul6)\
**Post date:** [January 18, 2024, 1:31pm UTC](https://community.prismic.io/t/sveltekit-project-error-with-slice-machine-error-500-on-draft-previews/15000/5 "2024-01-18T13:31:18Z")

</div>

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 [read.me](http://read.me) I'll be happy to help you with anything you might need):  
[https://github.com/paulduhard/gwenaelle-lepeltier](https://github.com/paulduhard/gwenaelle-lepeltier)

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

Paul

---

<div class="post-metadata">

**Author:** ![paul6](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/paul6/32/5691_2.png) [@paul6](https://community.prismic.io/u/paul6)\
**Post date:** [January 18, 2024, 1:40pm UTC](https://community.prismic.io/t/sveltekit-project-error-with-slice-machine-error-500-on-draft-previews/15000/6 "2024-01-18T13:40:47Z")

</div>

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 😅

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [January 19, 2024, 3:42pm UTC](https://community.prismic.io/t/sveltekit-project-error-with-slice-machine-error-500-on-draft-previews/15000/7 "2024-01-19T15:42:03Z")

</div>

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.

Sam

---

<div class="post-metadata">

**Author:** ![samlittlefair](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/samlittlefair/32/696_2.png) [@samlittlefair](https://community.prismic.io/u/samlittlefair)\
**Post date:** [February 16, 2024, 2:06pm UTC](https://community.prismic.io/t/sveltekit-project-error-with-slice-machine-error-500-on-draft-previews/15000/8 "2024-02-16T14:06:33Z")

</div>

Hey @paul6,

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

Sam
