prismicio / prismic-vue

Vue plugin, components, and composables to fetch and present Prismic content
https://prismic.io/docs/technologies/vuejs
Apache License 2.0
65 stars 16 forks source link

Is there compatability with Vue 3? I’m having issues migrating #41

Closed Rhyspacker closed 3 years ago

Rhyspacker commented 3 years ago

Hi there, I decided to update my personal website which uses Vue JS and Prismic. All was working smoothly until I migrated my Vue 2 > Vue 3 via the Vue CLI.

I get this js error in the console (full screenshot below) "Cannot set property '$prismic' of undefined". I believe it's because of the core changes to Vue, i.e. Vue.use(PrismicVue, ... has changed and I now use a variable referencing createApp(). I.e. my new code is vueApp.use(PrismicVue, ... and I think this is maybe causing the initialisation issue.

Also with Vue 3 we don't even import Vue from 'vue' anymore, it's all handled with createApp.

Please let me know if you have any advice or fixes for this, I'd like to use Vue 3 and Prismic so it would be ideal. Thanks in advance.

https://aws1.discourse-cdn.com/business20/uploads/prismic/original/2X/4/47d4ca716badb58692ea9ca487da1a5e57e6d2fc.png - Full screenshot of console error.

CalebKester commented 3 years ago

I'm also wondering about the status on this.

lihbr commented 3 years ago

Hey! Glad to see you all have an interest in Vue 3. I can't give you an ETA yet, but we'll start to work on a new major of Vue kit really soon in March with Nuxt 3 coming in April.

In the meantime, if you need to use Prismic with Vue 3 I can only suggest to fallback to @prismicio/client and prismic-dom.

lihbr commented 3 years ago

Hey @Rhyspacker, @CalebKester, I hope your journey with Vue 3 has been going well since last time!

I'm happy to announce you that we started working towards supporting Vue 3 and that we opened a Suggestion Thread for everyone to discuss feedback and improvements that could be made to this kit~

Cheers!