# SvelteKit - Cannot view draft preview

**URL:** <https://community.prismic.io/t/sveltekit-cannot-view-draft-preview/14665>\
**Category:** Developing with Prismic\
**Tags:** svelte\
**Created:** [December 5, 2023, 9:55am UTC](https://community.prismic.io/t/sveltekit-cannot-view-draft-preview/14665 "2023-12-05T09:55:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![robotkittens](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/robotkittens/32/6679_2.png) [@robotkittens](https://community.prismic.io/u/robotkittens)\
**Post date:** [December 5, 2023, 9:55am UTC](https://community.prismic.io/t/sveltekit-cannot-view-draft-preview/14665/1 "2023-12-05T09:55:27Z")

</div>

I've successfully configured the preview functionality, but I've noticed that only published content is visible in the preview, whereas the preview is mostly useful for draft content. I'm having difficulty in debugging this issue. Despite being redirected to the preview URL as expected, only published content appears. I would appreciate some help on how to troubleshoot this and ensure that the preview shows draft content as well.

---

<div class="post-metadata">

**Author:** ![robotkittens](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/robotkittens/32/6679_2.png) [@robotkittens](https://community.prismic.io/u/robotkittens)\
**Post date:** [December 5, 2023, 10:46am UTC](https://community.prismic.io/t/sveltekit-cannot-view-draft-preview/14665/2 "2023-12-05T10:46:47Z")

</div>

I want to add that I do not see the 'io.prismic.previewSession' in the cookies for my website, but I do see it for the Prismic website.

 ![Screenshot 2023-12-05 at 11.45.58](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/5/55229987829a59b2b9b0e8873e18a4cd9923d807.png)

 ![Screenshot 2023-12-05 at 12.24.55](https://europe1.discourse-cdn.com/flex013/uploads/prismic/original/2X/9/976bccdc23d641120499c1554f6044240607e30e.png)

Maybe this is part of the issue?

---

<div class="post-metadata">

**Author:** ![robotkittens](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/robotkittens/32/6679_2.png) [@robotkittens](https://community.prismic.io/u/robotkittens)\
**Post date:** [December 5, 2023, 12:38pm UTC](https://community.prismic.io/t/sveltekit-cannot-view-draft-preview/14665/3 "2023-12-05T12:38:21Z")

</div>

I managed to find the solution to the issue. It turned out that our project was utilizing a different, possibly older, version of code for displaying previews. Specifically, our `prismicio.js` file had the following line:

`client.enableAutoPreviewsFromReq(client, cookies);`

However, the correct and updated version, as per the documentation, is:

`enableAutoPreviews({ client, cookies });`

For those encountering a similar problem, it's crucial to strictly follow the documentation. If any code appears different or outdated, replace it with the corresponding snippet from the official documentation to ensure compatibility and proper functionality.

---

<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:** [December 6, 2023, 5:33pm UTC](https://community.prismic.io/t/sveltekit-cannot-view-draft-preview/14665/5 "2023-12-06T17:33:05Z")

</div>

Thanks for posting the problem and the solution, @robotkittens!
