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

Render error in Vue3 #27

Open
mpancewicz opened this issue Feb 25, 2021 · 9 comments
Open

Render error in Vue3 #27

mpancewicz opened this issue Feb 25, 2021 · 9 comments
Assignees
Labels
enhancement New feature or request vue3 Vue 3 compatibility

Comments

@mpancewicz
Copy link

I can't make it work in Vue3.
During render I got warning "Property "$createElement" was accessed during render but is not defined on instance."
Essentially _vm.$createElement is undefined.

Here's my component:

<template>
  <vue-svg-map :map="Taiwan"></vue-svg-map>
</template>

<script>
import { SvgMap } from 'vue-svg-map';
import Taiwan from '@svg-maps/taiwan';

export default {

  components: {
    'chart': Chart,
    'vue-svg-map': SvgMap,
  },

	data() {
		return {
			Taiwan
		};
	}


}
</script>
@VictorCazanave
Copy link
Owner

Thank you for reporting this issue @mpancewicz!
This component was built for Vue 2, then I'm not surprised it doesn't work directly with Vue 3.

I'll try to make it compatible when I have free time (probably not before 2 weeks 😥).
If you know how to fix it (keeping the Vue 2 compatibility), feel free to open a PR!

@VictorCazanave VictorCazanave added the vue3 Vue 3 compatibility label Feb 25, 2021
@mpancewicz
Copy link
Author

Thanks,
I'd try to fix it, but as we all do I also have a problem with a free time.

@Neon22
Copy link

Neon22 commented Jun 28, 2021

I have a similar problem.
It doesn't look to me like both v2 and v3 can be serviced by the same code but then again maybe only the wrapper needs to have two versions as the options API still works in v3.

I don't know enough but I'll leave this here because it looks like how to change the three .vue files :

@VictorCazanave
Copy link
Owner

Thank you for the link @Neon22!

My initial plan was to keep the same components (hoping they would be compatible with Vue 3) and update the wrapper to support both Vue 2 and Vue 3, but I didn't find any resources about how to do that.
Then, now I'm thinking to still keep the options API, to modify the components as less as possible (probably only the v-model), and create a new wrapper for Vue 3.

@Neon22
Copy link

Neon22 commented Jul 15, 2021

Also leaving this here - allows packaging for Vue2 and 3 at the same time... magical
https://github.com/vueuse/vue-demi

Ran into it here: https://vueuse.org/

@MoeBensu
Copy link

MoeBensu commented Aug 16, 2021

@VictorCazanave

My initial plan was to keep the same components (hoping they would be compatible with Vue 3) and update the wrapper to support both Vue 2 and Vue 3, but I didn't find any resources about how to do that.

wrapper.js could be easily made vue-3 compatible and also typed for ts support.

However, I identified multiple breaking changes in code, besides v-model, and also some necessary changes in the build config, etc. You might want to check out the migration build. Maybe, it is easier having a @next version of the plugin instead of maintaining compatibility for vue-2 and vue-3 in the same place.

@matzborba
Copy link

Is there already a version that works in vue 3?

@VictorCazanave
Copy link
Owner

However, I identified multiple breaking changes in code, besides v-model, and also some necessary changes in the build config, etc. You might want to check out the migration build. Maybe, it is easier having a @next version of the plugin instead of maintaining compatibility for vue-2 and vue-3 in the same place.

(Very late) Thanks for your feedback!

Is there already a version that works in vue 3?

Not yet. I'll try to work on it in the following weeks.

@VictorCazanave VictorCazanave self-assigned this Feb 24, 2023
@VictorCazanave VictorCazanave added the enhancement New feature or request label Feb 24, 2023
@dholly
Copy link

dholly commented Aug 17, 2024

any updates on vue 3 version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vue3 Vue 3 compatibility
Projects
None yet
Development

No branches or pull requests

6 participants