chartjs / chartjs/Chart.js

color$1.Color is not a constructor

Open
#11,193 3 comments 1 reaction 0 assignees View on GitHub
type: bug
Dominant language
JavaScript
Stars
67.7k
Forks
11.9k
Avg merge
7h 39m
Merged PRs (30d)
5

Description

### Expected behavior

Hovering and toggling series should not throw exception.

### Current behavior

Hovering and toggling series throws exception

### Reproducible sample

https://codesandbox.io/p/github/seikosantana/chart-test-remote/master?file=%2Fpackage.json&workspace=%257B%2522activeFileId%2522%253A%2522clfdl46qp000yg3d0bapxfjqr%2522%252C%2522openFiles%2522%253A%255B%2522%252FREADME.md%2522%252C%2522%252Fwebpack-demo.config.js%2522%255D%252C%2522sidebarPanel%2522%253A%2522EXPLORER%2522%252C%2522gitSidebarPanel%2522%253A%2522COMMIT%2522%252C%2522spaces%2522%253A%257B%2522clfdl48wb000x3v6mn9qbcihp%2522%253A%257B%2522key%2522%253A%2522clfdl48wb000x3v6mn9qbcihp%2522%252C%2522name%2522%253A%2522start%2522%252C%2522devtools%2522%253A%255B%257B%2522type%2522%253A%2522PREVIEW%2522%252C%2522taskId%2522%253A%2522start%2522%252C%2522port%2522%253A9090%252C%2522key%2522%253A%2522clfdlby3o01ev3v6m1j005uyo%2522%252C%2522isMinimized%2522%253Afalse%257D%252C%257B%2522type%2522%253A%2522TASK_LOG%2522%252C%2522taskId%2522%253A%2522start%2522%252C%2522key%2522%253A%2522clfdlbv1v01at3v6mvnrk3zcz%2522%252C%2522isMinimized%2522%253Afalse%257D%255D%257D%257D%252C%2522currentSpace%2522%253A%2522clfdl48wb000x3v6mn9qbcihp%2522%252C%2522spacesOrder%2522%253A%255B%2522clfdl48wb000x3v6mn9qbcihp%2522%255D%252C%2522hideCodeEditor%2522%253Afalse%257D

### Optional extra steps/info to reproduce

Hover on the chart to see the error being thrown.

### Possible solution

_No response_

### Context

I am using chart.js in a [remote-component](https://www.npmjs.com/package/@paciolan/remote-component), and the repro sample is a fork of [remote-component-starter](https://github.com/Paciolan/remote-component-starter) with updated dependencies and typescript added.

I tried on a freshly created project with CRA and the issue does not occur. I suspect it is related to modules thing or webpack configurations, but I'm not yet familiar enough to figure out what to do about it.

### chart.js version

4.2.1

### Browser name and version

_No response_

### Link to your project

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.