简体   繁体   English

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

[英]Browserify gives me Uncaught TypeError: Cannot read property 'prototype' of undefined

I have tried installing npm browserify globally with a command npm i -g browserify .我尝试使用命令npm i -g browserify全局安装 npm npm i -g browserify Then I wrote in terminal browserify app.js -o bundle.js command, which created bundle.js file, and then I went to my index.html and I changed my script to <script defer src="bundle.js"/> .然后我在终端浏览器中编写browserify app.js -o bundle.js命令,它创建了 bundle.js 文件,然后我去我的 index.html 并将我的脚本更改为<script defer src="bundle.js"/> . I went to check and indeed error Uncaught referenceError: require is not defined is gone, but I have this new error:我去检查,确实错误 Uncaught referenceError: require is not defined 消失了,但我有这个新错误:

bundle.js:41149 Uncaught TypeError: Cannot read property 'prototype' of undefined
    at Object.<anonymous> (bundle.js:41149)
    at Object.236../utils (bundle.js:42251)
    at o (bundle.js:1)
    at bundle.js:1
    at Object.232../application (bundle.js:40389)
    at o (bundle.js:1)
    at bundle.js:1
    at Object.230../lib/express (bundle.js:39717)
    at o (bundle.js:1)
    at bundle.js:1
(anonymous) @ bundle.js:41149
236../utils @ bundle.js:42251
o @ bundle.js:1
(anonymous) @ bundle.js:1
232../application @ bundle.js:40389
o @ bundle.js:1
(anonymous) @ bundle.js:1
230../lib/express @ bundle.js:39717
o @ bundle.js:1
(anonymous) @ bundle.js:1
(anonymous) @ bundle.js:36124
206._process @ bundle.js:36133
o @ bundle.js:1
r @ bundle.js:1
(anonymous) @ bundle.js:1

This is my app.js file, index html has nothing in it.这是我的 app.js 文件,索引 html 中没有任何内容。 And bundle.js has like 60k lines of code, I can't show it. bundle.js 有 60k 行代码,我无法显示。

const express = require("express");
const app = express();

const PORT = process.env.PORT || 5500;

app.listen(PORT, () => {
  console.log(`Server is running on port ${PORT}`);
});

暂无
暂无

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

相关问题 未捕获的TypeError:无法读取未定义的属性“ prototype” - Uncaught TypeError : cannot read property 'prototype' of undefined Uncaught TypeError:无法读取未定义的属性“ prototype” - Uncaught TypeError: Cannot read property 'prototype' of undefined Typescript和Browserify-未捕获的TypeError:无法读取未定义的属性“ step” - Typescript and Browserify - Uncaught TypeError: Cannot read property 'step' of undefined Mathquill:未捕获的类型错误:无法读取未定义的属性“原型” - Mathquill: 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 无法理解为什么它给了我:未捕获(承诺)类型错误:无法读取未定义的属性“blabla” - Unable to understand why it gives me: Uncaught (in promise) TypeError: Cannot read property 'blabla' of undefined 它给 Uncaught TypeError: Cannot read property &#39;8&#39; of undefined 带来的“characterIndex”有什么问题? - what the problem with "characterIndex" it gives Uncaught TypeError: Cannot read property '8' of undefined? dataTable给出未捕获的TypeError:无法读取未定义的属性&#39;mData&#39; - dataTable gives Uncaught TypeError: Cannot read property 'mData' of undefined
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM