vue-chartjs 5 error: "You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file"

huangapple go评论74阅读模式
英文:

vue-chartjs 5 error: "You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file"

问题

我正在运行:

  • "vue-chartjs": "^5.2.0",
  • "chart.js": "^4.2.1",
  • "vue": "2.7.14",

我相信这些是正确且兼容的软件包版本。

然而,当我尝试运行项目时,我遇到以下错误:

您可能需要适当的加载程序来处理此文件类型,目前没有配置加载程序来处理此文件。请参阅 https://webpack.js.org/concepts#loaders

这个问题与 此问题 有关,但与之不同,因为使用 chart.js 3.9.1 无法解决我的问题。当使用 chart.js 3.9.1 时,我会收到以下完整错误:

错误信息:在 ./node_modules/vue-chartjs/dist/index.js 中解析模块失败。

出现意外令牌 (198:37)。
您可能需要适当的加载程序来处理此文件类型,目前没有配置加载程序来处理此文件。请参阅 https://webpack.js.org/concepts#loaders

英文:

I am running:

  • "vue-chartjs": "^5.2.0",
  • "chart.js": "^4.2.1",
  • "vue": "2.7.14",

I believe these are the correct and compatiable package versions.

However when I try to run the project I get the error:

You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

This question is related to but not the same as this one as using chart.js 3.9.1 does not solve my problem. When using chart.js 3.9.1 I get the following full error:

 error  in ./node_modules/vue-chartjs/dist/index.js

Module parse failed: Unexpected token (198:37)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders

答案1

得分: 1

Vue 2 不支持 vue-chartjs 和 chart.js 的这些版本。

我使用以下版本

  • "chart.js": "^3.8.0"
  • "vue-chartjs": "^4.0.0"
  • "vue": "^2.7.14"

你可以在这里找到一些实现的例子:

https://vue-chartjs.org/examples/#vue-2-charts-vue-chartjs-v4

英文:

Vue 2 doesn't support the versions of vue-chartjs and chart.js.

I use the following versions

  • "chart.js": "^3.8.0"
  • "vue-chartjs": "^4.0.0"
  • "vue": "^2.7.14"

You can find some examples of implementation over here:

https://vue-chartjs.org/examples/#vue-2-charts-vue-chartjs-v4

huangapple
  • 本文由 发表于 2023年3月9日 22:11:00
  • 转载请务必保留本文链接:https://go.coder-hub.com/75685745.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定