Problem with @sanity/ui when compiling with Vite #3918
Replies: 1 comment 2 replies
-
I seem to have the same issue. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! I'm currently using Sanity embedded inside a Sveltekit App and it works great in local when building with vite dev mode. Although there seems to be a problem with sanity/ui and sanity/icons when building for prod.
In my app, I'm following what Chris Jayden said about Sanity Preview embedded inside Sveltekit shown here https://chrisjayden.com/articles/sveltekit-sanity-content-preview. I have a React component which uses sanity/ui to build the preview mode and it imports components like that
import {Card, Text} from '@sanity/ui'
As I said, it works fine in dev mode, but when Vite is running in built mode I get this message :
but the solution shown here doesn't work as 'default' is not exported.
I'm also using sanity/icons for my Sanity documents and I get the same error for BookIcon.
Is there anything I can do to resolve this?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions