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]: Warning when using with svelte version ^4.0.0 #116

Closed
1 task
netcodedev opened this issue Jul 24, 2023 · 7 comments
Closed
1 task

[Bug]: Warning when using with svelte version ^4.0.0 #116

netcodedev opened this issue Jul 24, 2023 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@netcodedev
Copy link

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

Library should just work without errors or warnings

Reproduction

https://codesandbox.io/p/sandbox/black-wood-2hz8vj

chart.js version

^4.3.0

svelte-chartjs version

^3.1.2

Possible solution

Update the dependency to svelte@^4.0.0

@netcodedev netcodedev added the bug Something isn't working label Jul 24, 2023
@okuruu
Copy link

okuruu commented Jul 24, 2023

I have the same issue..

@diramazioni
Copy link

More then a warning, it just doesn't work!, And doesn't produce any visible error either, beside the console log hinting to add import for Filler option that I did I see no further error.
In ts/vscode I see error if I hover in {data} for <Line {data} options={{ responsive: true }} />

Type '{ labels: string[]; datasets: { label: string; fill: boolean; lineTension: number; backgroundColor: string; borderColor: string; borderCapStyle: string; borderDash: never[]; borderDashOffset: number; ... 10 more ...; data: number[]; }[]; }' is not assignable to type 'ChartData<"line", (number | Point)[], unknown>'.
  Types of property 'datasets' are incompatible.
    Type '{ label: string; fill: boolean; lineTension: number; backgroundColor: string; borderColor: string; borderCapStyle: string; borderDash: never[]; borderDashOffset: number; borderJoinStyle: string; ... 9 more ...; data: number[]; }[]' is not assignable to type 'ChartDataset<"line", (number | Point)[]>[]'.
      Type '{ label: string; fill: boolean; lineTension: number; backgroundColor: string; borderColor: string; borderCapStyle: string; borderDash: never[]; borderDashOffset: number; borderJoinStyle: string; ... 9 more ...; data: number[]; }' is not assignable to type 'ChartDataset<"line", (number | Point)[]>'.

so the problem may be due to a change of chartjs dataset format?

@SkepticMystic
Copy link

I can confirm that @rbozan's suggestion (#112) works in my project:

For installing through npm:

npm i github:SauravKanchan/svelte-chartjs#renovate/svelte-4.x --force

Or you can just override it in package.json

  "overrides": {
    "svelte-chartjs": {
      "svelte": ">=4.x"
    }
  }

Specifically, the overrides option works for me, I have not tried the first approach.

@thomasdom
Copy link

@SauravKanchan any updates on this topic? We'll be implementing the workaround mentioned above, but it would be better if the lib was updated properly 👍🏼

@exislow
Copy link

exislow commented Oct 17, 2023

+1

Can you please update it?

@niemyjski
Copy link
Collaborator

I think this will be resolved in the next update.

@niemyjski niemyjski self-assigned this Jan 30, 2024
@niemyjski
Copy link
Collaborator

This is fixed in the latest release https://github.com/SauravKanchan/svelte-chartjs/releases/tag/v3.1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants