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

[Bug]: Vue 2.7 usage - runtime errors + legacy seems to be removed but not mentioned in migration guide #966

Closed
1 task
jacekkarczmarczyk opened this issue Dec 6, 2022 · 7 comments · Fixed by #967
Assignees

Comments

@jacekkarczmarczyk
Copy link

jacekkarczmarczyk commented Dec 6, 2022

Would you like to work on a fix?

  • Check this if you would like to implement a PR, we are more than happy to help you go through the process.

Current and expected behavior

Although it's mentioned in migration guide that the package supports Vue 2.7 I have difficulties with making it working.
First - importing from vue-chartjs/legacy doesn't work any more:

// Module not found: Error: Package path ./legacy is not exported from package ...
import { Bar as BarChart } from 'vue-chartjs/legacy'; 

Second - importing from 'vue-chartjs' throws missing property errors, even after changing them from chart-data to data etc.

image

Reproduction

https://stackblitz.com/edit/github-tqxopy?file=src%2FApp.vue

chart.js version

4.0.1

vue-chartjs version

5.0.0

Possible solution

No response

@apertureless
Copy link
Owner

apertureless commented Dec 6, 2022

The migration guide is for vue-chartjs 3 -> 4
If you want to use vue-chartjs with vue < 2.7 you have to lock your version to 4.x

As stated in the release notes and changelog we dropped the legacy support with vue-chartjs 5

https://github.com/apertureless/vue-chartjs/releases/tag/v5.0.0

@dangreen dangreen self-assigned this Dec 6, 2022
@dangreen
Copy link
Collaborator

dangreen commented Dec 6, 2022

@apertureless Actually, it should work with vue 2.7 cause it supports composition API. I'm researching it right now.

@jacekkarczmarczyk
Copy link
Author

jacekkarczmarczyk commented Dec 6, 2022

@apertureless do you mean that https://vue-chartjs.org/migration-guides/#migration-from-v4-to-v5 is the migration guide 3 -> 4?

also I don't see dropping support for Vue 2.x in the release notes
image

@apertureless
Copy link
Owner

apertureless commented Dec 6, 2022

Sorry misread. I thought you're talking about vue < 2.7 .
We dropped the support for the legacy wrapper which was for vue < 2.7 so thats at least why you can't import from 'vue-chartjs/legacy'

@jacekkarczmarczyk jacekkarczmarczyk changed the title [Bug]: Vue 2.x usage - runtime errors + legacy seems to be removed but not mentioned in migration guide [Bug]: Vue 2.7 usage - runtime errors + legacy seems to be removed but not mentioned in migration guide Dec 6, 2022
@dangreen
Copy link
Collaborator

dangreen commented Dec 6, 2022

@jacekkarczmarczyk Released in v5.0.1

@jacekkarczmarczyk
Copy link
Author

That was quick! Thank you ;)

@jacekkarczmarczyk
Copy link
Author

I can confirm it works fine now, but I'd suggest to add to the release notes and migration guide information that for Vue 2.7 you need to remove /legacy from the import path

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

Successfully merging a pull request may close this issue.

3 participants