Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying to use this with Vue 3 and Vite #148

Closed
krry opened this issue Jan 25, 2021 · 3 comments
Closed

Trying to use this with Vue 3 and Vite #148

krry opened this issue Jan 25, 2021 · 3 comments
Assignees

Comments

@krry
Copy link

krry commented Jan 25, 2021

📚 What are you trying to do? Please describe.
I have a Vue 3 web app that builds with Vite and want to draw in data from my Sanity graph. Vite is an ESM-only build system that doesn't know what require means, so it blows up when I try to use this lib to spin up the Sanity Client and fire the fetcher.

🔍 What have you tried?
I've tried cloning the next branch and changing the requires to imports. I'm not yet able to get it to build locally. It says it's missing lib/*. I can offer a more precise account of these attempts if helpful.

I have also tried to find a way to shoehorn Vite into CommonJS compatibility or interpreting requires, but that's a pretty strong nope.

ℹ️ Additional context
Sanity is awesome and I really appreciate you offering this library. Would be rad to get it integrated with Vite, cuz that's super fast.

danielroe added a commit that referenced this issue Mar 7, 2021
Most notably this is lacking ssr support with vue3 pending vuejs/core#3070

see #148 for latest progress & status
@danielroe
Copy link
Owner

Thanks @krry. Just to update you, we're just waiting on vuejs/core#3070 to be merged for full ssr support. I've released a version with experimental Vite/Vue3 support that you can try by installing vue-sanity@vite but would value feedback/issues as I expect there will be some!

@danielroe
Copy link
Owner

This should now be fully working in 0.11.0. Let me know if you have any issues!

@krry
Copy link
Author

krry commented Aug 16, 2021

This should now be fully working in 0.11.0. Let me know if you have any issues!

Woo! Thanks, will fire it up shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants