简体   繁体   English

Mathquill:未捕获的类型错误:无法读取未定义的属性“原型”

[英]Mathquill: Uncaught TypeError: Cannot read property 'prototype' of undefined

I'm currently trying to implement MathQuill in a project that I'm working on.我目前正在尝试在我正在从事的项目中实施 MathQuill。 I installed the package via NPM ( npm install mathquill ) and put the following <script> s in the <head> :我通过 NPM ( npm install mathquill ) 安装了该软件包,并将以下<script>放在<head>

<script src="../node_modules/jquery/dist/jquery.min.js"></script>
<script src="../node_modules/mathquill/build/mathquill.js"></script>

When I load the page, however, I get an error message in Chrome's Dev Tools Console saying但是,当我加载页面时,我在 Chrome 的开发工具控制台中收到一条错误消息,说

Uncaught TypeError: Cannot read property 'prototype' of undefined
    at P (mathquill.js:157)
    at mathquill.js:254
    at mathquill.js:4982
P @ mathquill.js:157
(anonymous) @ mathquill.js:254
(anonymous) @ mathquill.js:4982

I've looked at other people having similar problems, but none are having the problem I did and I can't seem to resolve it.我看过其他有类似问题的人,但没有人遇到我遇到的问题,而且我似乎无法解决。 How should I fix it?我该如何解决?

Edit:编辑:

I figured out the problem.我解决了这个问题。 While the docs says JQuery 1.5.2+, it seems to break on whatever the latest version is.虽然文档说 JQuery 1.5.2+,但它似乎破坏了最新版本。 I just took the link that they used on their site and it seemed to have worked.我只是拿了他们在他们网站上使用的链接,它似乎奏效了。

Not sure what was your exact problem but it seems the node package was last updated quite a few years back.不确定您的确切问题是什么,但似乎节点包上次更新是在几年前。 Also, the default version of cdnjs points to version 0.9.x which is giving a similar error.此外, cdnjs的默认版本指向版本 0.9.x,它给出了类似的错误。

Using the latest version solved the problem.使用最新版本解决了这个问题。 Here is a codepen with a working example.这是一个带有工作示例的代码笔

<script src='https://cdnjs.cloudflare.com/ajax/libs/mathquill/0.10.1-a/mathquill.min.js'></script>

Also, it doesn't seem to be related to the jQuery version as I used: 3.6.0 and it still works.此外,它似乎与我使用的 jQuery 版本无关:3.6.0 并且它仍然有效。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Uncaught TypeError:无法读取未定义的属性“ prototype” - Uncaught TypeError: Cannot read property 'prototype' of undefined 未捕获的TypeError:无法读取未定义的属性“ prototype” - Uncaught TypeError : cannot read property 'prototype' of undefined Browserify 给了我未捕获的类型错误:无法读取未定义的属性“原型” - Browserify gives me Uncaught TypeError: Cannot read property 'prototype' of undefined 如何修复未捕获的类型错误:无法读取未定义的属性“原型”? - How to fix Uncaught TypeError: Cannot read property 'prototype' of undefined? highcharts heatmap未捕获的TypeError:无法读取未定义的属性“ prototype” - highcharts heatmap Uncaught TypeError: Cannot read property 'prototype' of undefined Uncaught TypeError:无法读取原型函数中未定义的属性“值” - Uncaught TypeError: Cannot read property 'value' of undefined in prototype functions 未捕获的TypeError:无法读取未定义的属性“未定义” - Uncaught TypeError: Cannot read property 'undefined' of undefined Reactjs - × TypeError:无法读取未定义的属性“原型” - Reactjs - × TypeError: Cannot read property 'prototype' of undefined 业力:TypeError:无法读取未定义的属性“ prototype” - karma: TypeError: Cannot read property 'prototype' of undefined TypeError:无法读取未定义的属性“ prototype” - TypeError: Cannot read property 'prototype' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM