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

[ChartJS] Using chartjs/auto + importmap is not compatible with date adapters #1695

Open
simondaigre opened this issue Apr 8, 2024 · 5 comments

Comments

@simondaigre
Copy link
Contributor

Following this thread on Symfony Slack : https://symfony-devs.slack.com/archives/C01FN4EQNLX/p1709732205012939

The workaround seems hacky IMHO.
Maybe we should require chartjs only ?

@smnandre
Copy link
Collaborator

smnandre commented Apr 8, 2024

Could you resume the problem and suggested workaround here ? As the Symfony Slack does not keep messages very long

@simondaigre
Copy link
Contributor Author

Symfony UX requires chartjs/auto while Chart JS plugins require chartjs.
This is causing issues with assetmapper.

Workaround:

Almost got it, just need some advise how to resolve it properly.What I did:

    forced /auto  version to be 4.4.1
    in app.js I've just added import 'chartjs-adapter-date-fns'
    in app/assets/vendor/chartjs-adapter-date-fns/chartjs-adapter-date-fns.index.js

 there was import{_adapters as e}from"chart.js" which I've changed to import{_adapters as e}from"chart.js/auto"

But it requires to edit a vendor file...

I see this is duplicate of #1474 (comment) so we can close this issue.

@smnandre
Copy link
Collaborator

I realise i stated something : #1263

@simondaigre
Copy link
Contributor Author

@smnandre I just checked on my project, #1263 solves my issue.

@smnandre
Copy link
Collaborator

@simondaigre I'm having difficulties to clean / finalize the PR #1263 in question.. would you take a look and see if you can help there.. ? :)

I think we're almost there but i'm fighting with CI errors / Chartjs 3.9.1

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

2 participants