![](/img/trans.png)
[英]AngularJS & Jasmine/Karma - Uncaught ReferenceError: require is not defined
[英]Require not defined error: Karma and Jasmine
我正在測試nodejs API,並且在karma.config.js中包含了文件
我收到以下錯誤:需求未定義。 然后根據其他帖子中給出的建議,我將browserify添加到該文件,但是現在我得到了不同的錯誤。
` files: [
'poc/app/api.js', // file where there is require statements
'tests/sample.test.js' // my test file
],
preprocessors: {
'poc/app/api.js':['browserify']
},`
Uncaught TypeError: Cannot read property 'prototype' of undefined
Please let me know how to resolve this.
Uncaught TypeError:無法讀取未定義的屬性“ prototype”
此錯誤還應該包括文件名和行號。 由於您未包含該信息或源代碼,因此在此只能給出的建議是檢查該文件的該行,查看未定義的內容,跟蹤其到達方式,應在何處定義但未定義並解決造成該問題的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.