codegouvfr / codegouvfr/react-dsfr

Compatibility with @gouvfr/dsfr-chart 2.x

Open
#391 8 comments 1 reaction 0 assignees View on GitHub
Dominant language
TypeScript
Stars
496
Forks
99
Avg merge
15h 36m
Merged PRs (30d)
4

Description

By default when installing @gouvfr/dsfr-chart, it will install version 2.x that is not compatible with react-dsfr.
I got the following error when trying to use the bar chart component:
```
✘ [ERROR] Missing "./BarChart/bar-chart.common" specifier in "@gouvfr/dsfr-chart" package [plugin vite:dep-pre-bundle]

node_modules/@codegouvfr/react-dsfr/Chart/BarChart.js:4:7:
4 │ import "@gouvfr/dsfr-chart/BarChart/bar-chart.common";
╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This error came from the "onResolve" callback registered here:

node_modules/esbuild/lib/main.js:1151:20:
1151 │ let promise = setup({
╵ ^

at setup (file:///home/tocab/Projects/Clients/IGN/cartes.gouv.fr/node_modules/vite/dist/node/chunks/dep-ByPKlqZ5.js:16969:13)
at handlePlugins (/home/tocab/Projects/Clients/IGN/cartes.gouv.fr/node_modules/esbuild/lib/main.js:1151:21)
at buildOrContextImpl (/home/tocab/Projects/Clients/IGN/cartes.gouv.fr/node_modules/esbuild/lib/main.js:874:5)
at Object.buildOrContext (/home/tocab/Projects/Clients/IGN/cartes.gouv.fr/node_modules/esbuild/lib/main.js:700:5)
at /home/tocab/Projects/Clients/IGN/cartes.gouv.fr/node_modules/esbuild/lib/main.js:2039:68
at new Promise ()
at Object.context (/home/tocab/Projects/Clients/IGN/cartes.gouv.fr/node_modules/esbuild/lib/main.js:2039:27)
at Object.context (/home/tocab/Projects/Clients/IGN/cartes.gouv.fr/node_modules/esbuild/lib/main.js:1881:58)
at prepareEsbuildOptimizerRun (file:///home/tocab/Projects/Clients/IGN/cartes.gouv.fr/node_modules/vite/dist/node/chunks/dep-ByPKlqZ5.js:19170:33)
```

It would be great if react-dsfr can be compatible with version 2.x of @gouvfr/dsfr-chart

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.