Skip to content

Rollup build failing since Chart.js 3.9 #10599

@t-richard

Description

@t-richard

Expected behavior

The build would not fail when running rollup -c.

Current behavior

We're using Chart.js with Typescript and importing it with chart.js/auto.

Since 3.9.0, our rollup build is failing with the follwing error message

Could not resolve '../types/index.esm' from node_modules/chart.js/auto/auto.mts

I think it's related to this change but not entirely sure about why: #10479

Reproducible sample

https://github.com/t-richard/chartjs-rollup-reproducer

Optional extra steps/info to reproduce

When cloning this repo, running those commands will fail

yarn install
rollup -c

Downgrading to 3.8.2 fixes the build.

Possible solution

No response

Context

This has been encountered in the CI of Symfony UX where we have a Chart.js component. Since the 3.9.0, our build is failing with this error and we can't figure out why or a way to fix it properly.

See for example: https://github.com/symfony/ux/runs/7813370449?check_suite_focus=true

I'll gladly provide any details that may be missing in this report.

Thanks!

chart.js version

3.9.0

Browser name and version

No response

Link to your project

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions