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

Framework-relate bug when importing adapters. #11709

Open
mstonepc opened this issue Mar 10, 2024 · 2 comments
Open

Framework-relate bug when importing adapters. #11709

mstonepc opened this issue Mar 10, 2024 · 2 comments

Comments

@mstonepc
Copy link

mstonepc commented Mar 10, 2024

Expected behavior

The adapter import should modify the correct chart.js instance.

Current behavior

When importing in a framework like ember, or react, because the package.json points requireJS to the ".cjs" file, and the import in those frameworks happens in node during build time, the adapter does not import the same chart instance, and therefore the adapter does not work.

Reproducible sample

#11376

Possible Solution

Perhaps both chart.js and chart.cjs in dist can target the same chart instance? I haven't dug too deep on how this is all setup right now. Does require really need the .cjs version?

chart.js version

v4

@etimberg
Copy link
Member

This is likely because the Chart instance is just a global variable and there are two copies when two separate imports exist

@eg271
Copy link

eg271 commented May 8, 2024

Am trying to use a chartjs plugin (chartjs-financial) and the same code that works perfectly in a simple non-framework app gives an error that it can't find the required controller (candlestick in this case) when using Ember. So, perhaps this is caused by the same error - is there a workaround right now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants