未捕获的 ReferenceError:未定义要求 - Chart.js [英] Uncaught ReferenceError : require is not defined - Chart.js

查看:32
本文介绍了未捕获的 ReferenceError:未定义要求 - Chart.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Chart.js(新版本)作为:

I use Chart.js(new version) as :

<script src="~/Plugin/Chart.js/src/chart.js"></script>

但是当我在 chrome 中演示时,我得到一个错误:

But when i demo in chrome, i get a error :

chart.js:4 Uncaught ReferenceError: require is not defined

图片

推荐答案

在您的代码中,改为拉取捆绑包.例如 ~/Plugin/Chart.js/dist/Chart.bundle.js

in your code, pull the bundle instead. E.g ~/Plugin/Chart.js/dist/Chart.bundle.js

这篇关于未捕获的 ReferenceError:未定义要求 - Chart.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆