LoginSignup
0
0

More than 1 year has passed since last update.

vue-chartjsで export 'default' xxx was not found in 'chart.js' エラーが出るとき

Last updated at Posted at 2021-09-09

vue-chartjs公式を参考に導入してみたら、以下のエラーが出てしまった。

export 'default' xxx was not found in 'chart.js'

原因

chart.jsの最新バージョン(3.x系)にvue-chartjsが対応していなかった。

以下のように素直にインストールするとchart.jsは3.x系がインストールされるので、ダウングレードする必要がある。

yarn add vue-chartjs chart.js

対応

2.x系の最終版はv2.9.4らしいので、そちらを導入

yarn remove chart.js 
yarn add chart.js@2.9.4

エラー解消し、無事チャートが描画された

参考

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0