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

Error when upgrading from Chart.js 3.0 to 4.4 #150

Open
biren34 opened this issue Oct 30, 2023 · 6 comments
Open

Error when upgrading from Chart.js 3.0 to 4.4 #150

biren34 opened this issue Oct 30, 2023 · 6 comments
Assignees

Comments

@biren34
Copy link

biren34 commented Oct 30, 2023

First, thank you for this great candlestick plot.

I downloaded the example and was able to get it running with my data. I then tried to upgrade to chart.js 4.4 by changing the include in index.html from <script src="https://cdn.jsdelivr.net/npm/chart.js@3.0.1/dist/chart.js"></script> to <script src="https://cdn.jsdelivr.net/npm/chart.js@4.4.0/dist/chart.umd.min.js"></script>.

I now get an "Uncaught TypeError: String.prototype.toString requires that 'this' be a String" error, with a pretty unhelpful call stack:
image

Any help would be appreciated!

@attilacsanyi
Copy link

attilacsanyi commented Dec 19, 2023

We have the same issue @biren34, any update on this did you manage to solve the issue above? Thank you so much.

@santam85
Copy link
Collaborator

santam85 commented Feb 23, 2024

It seems to be due to incomplete datasets defaults for the library and some assumptions Chart.js makes on the default property values, working on it and releasing a new patch soon, it will require a breaking change to the configuration of the financial charts datasets.

@santam85 santam85 self-assigned this Feb 27, 2024
@varad11
Copy link

varad11 commented Mar 6, 2024

I face this issue when I do npm i chartjs-chart-financial
I'm using "chart.js": "4.4.2".

This is the error I get:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: my_app@0.0.0
npm ERR! Found: chart.js@4.4.2
npm ERR! node_modules/chart.js
npm ERR!   chart.js@"4.4.2" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer chart.js@"^3.2.0" from chartjs-chart-financial@0.1.1
npm ERR! node_modules/chartjs-chart-financial
npm ERR!   chartjs-chart-financial@"*" from the root project

I see that @santam85 submitted a PR which is reviewed with no conflicts. So if it is merged to master and released on npm then that would be really helpful for all.

**Temporarily for now I have installed the major/chartjs-4 branch created by @santam85 to continue with my development.
Here is the command:
npm i "github:chartjs/chartjs-chart-financial#major/chartjs-4"

@santam85
Copy link
Collaborator

@varad11 any issues encountered with the branch version? If it looks good from your end I can try releasing (first time for me on this lib). Fixed by #170

@varad11
Copy link

varad11 commented Mar 12, 2024

@santam85 I tried but, the dist folder was missing after npm i "github:chartjs/chartjs-chart-financial#major/chartjs-4" command. Only types got installed. I checked package.json and the "module" field points to "dist/chartjs-chart-financial.min.js".

chart-fin

Since the actual files are missing, my console keeps showing bunch of errors.
I was using react-chartjs-2 wrapper over chart.js.

(I have now switched to different charting library because of the reoccurring compatibility issues between chart.js and it's plugins and react wrapper integrations.)

@santam85
Copy link
Collaborator

Please have a try with v0.2.0, you'll need to change your dataset options in accordance to what is shown in the updated examples.

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

4 participants