2๐
โ
From the error it seems like you are running chart.js version 3, while your config is v2 syntax so it might need chart.js version 2,
try running npm i chart.js@2.9.4
to install the latest version of v2, than it should work.
0๐
It seems that you are using version v.3.x.x, the implementation has changed with respect to v.2.x.x, as indicated:
barChartOptions: ChartConfiguration<'bar'>['options'] = { ... }
this will fix the error you get and not back step in version.
Source:stackexchange.com