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

查看:100
本文介绍了未捕获的ReferenceError:未定义require - 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

图片

推荐答案

,请改为使用捆绑包。 E.g~ / Plugin / Chart.js / dist / Chart.bundle.js

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

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

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