Chart js doesnt work in Vaadin 23

I have imported the dependency of chart.js 0.1.38 in the pom.xml, but when I ran the project I got this error message

2022-12-21 15:40:01.256  INFO 16836 --- [v-server-output] c.v.b.devserver.DevServerOutputTracker   : [vite] Failed to load source map for /generated/jar-resources/chart/hammer.min.js.```

Can you show the dependency you used? How did you use the component?

I am using this dependency <!-- --> <dependency> <groupId>org.vaadin.addons.chartjs</groupId> <artifactId>chartjs</artifactId> <version>0.1.38</version> </dependency> this is my pom.xml and I am using this java code ``` BarChartConfig config = new BarChartConfig();
.labels(“January”, “February”, “March”, “April”, “May”, “June”, “July”)
.addDataset(new BarDataset().type().label(“Dataset 1”).backgroundColor(“rgba(151,187,205,0.5)”).borderColor(“white”).borderWidth(2))
.addDataset(new LineDataset().type().label(“Dataset 2”).backgroundColor(“rgba(151,187,205,0.5)”).borderColor(“white”).borderWidth(2))
.addDataset(new BarDataset().type().label(“Dataset 3”).backgroundColor(“rgba(220,220,220,0.5)”))

            .text("Chart.js Combo Bar Line Chart")

    List<String> labels =;
    for (Dataset<?, ?> ds : {
        List<Double> data = new ArrayList<>();
        for (int i = 0; i < labels.size(); i++) {
            data.add((double) (Math.random() > 0.5 ? 1.0 : -1.0) * Math.round(Math.random() * 100));

        if (ds instanceof BarDataset) {
            BarDataset bds = (BarDataset) ds;

        if (ds instanceof LineDataset) {
            LineDataset lds = (LineDataset) ds;

    ChartJs chart = new ChartJs(config);

I recommend to fallback webpack using feature flags.

Based on discussion here it looks like underlying chart.js library is not compatible with Vite

I used webpack instead of vite as you mentioned and now it is working,

com.vaadin.experimental.webpackForFrontendBuild=true in the file