英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论