构建发布 web-mobile 报错 TypeError: Cannot read properties of undefined (reading 'prototype')

构建发布 web-mobile 报错 TypeError: Cannot read properties of undefined (reading ‘prototype’)。
摸不着头脑,前几天还好好的,几天代码下来,项目直接嗝屁了,而且找了好久不知道缘故,也没找到对应文章,还请大神们指点下迷津。
您一句话或许破解我当前困局,拜谢!

index.02425.js:87

TypeError: Cannot read properties of undefined (reading 'prototype')
at inheritsLoose (bundle.56409.js:2:2447)
at index.2a7bf.js:151:2501
at Object.execute (index.2a7bf.js:151:5210)
at i (system.bundle.6de80.js:1:4055)
at x (system.bundle.6de80.js:1:4024)
at system.bundle.6de80.js:1:3932
at Array.forEach (<anonymous>)
at x (system.bundle.6de80.js:1:3901)
at system.bundle.6de80.js:1:3932
at Array.forEach (<anonymous>)

我继续详细检查了下,找到出错点,提供给大神们审阅。 2447行对应字段为 prototype。 截图为:

代码为:

System.register("chunks:///_virtual/_rollupPluginModLoBabelHelpers.js", [], (function(e) {
"use strict";
return {
	execute: function() {
		function t(e, t) {
			for (var r = 0; r < t.length; r++) {
				var n = t[r];
				n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n)
			}
		}

		function r(t) {
			return (r = e("getPrototypeOf", Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
				return e.__proto__ || Object.getPrototypeOf(e)
			}))(t)
		}

		function n(t, r) {
			return (n = e("setPrototypeOf", Object.setPrototypeOf || function(e, t) {
				return e.__proto__ = t, e
			}))(t, r)
		}

		function i() {
			if ("undefined" == typeof Reflect || !Reflect.construct) return !1;
			if (Reflect.construct.sham) return !1;
			if ("function" == typeof Proxy) return !0;
			try {
				return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], (function() {}))), !0
			} catch (e) {
				return !1
			}
		}

		function o(t, r, u) {
			return (o = i() ? e("construct", Reflect.construct) : e("construct", (function(e, t, r) {
					var i = [null];
					i.push.apply(i, t);
					var o = new(Function.bind.apply(e, i));
					return r && n(o, r.prototype), o
				})))
				.apply(null, arguments)
		}

		function u(e) {
			return -1 !== Function.toString.call(e)
				.indexOf("[native code]")
		}

		function c(t) {
			var i = "function" == typeof Map ? new Map : void 0;
			return (c = e("wrapNativeSuper", (function(e) {
				if (null === e || !u(e)) return e;
				if ("function" != typeof e) throw new TypeError("Super expression must either be null or a function");
				if (void 0 !== i) {
					if (i.has(e)) return i.get(e);
					i.set(e, t)
				}

				function t() {
					return o(e, arguments, r(this)
						.constructor)
				}
				return t.prototype = Object.create(e.prototype, {
					constructor: {
						value: t,
						enumerable: !1,
						writable: !0,
						configurable: !0
					}
				}), n(t, e)
			})))(t)
		}
		e({
			applyDecoratedDescriptor: function(e, t, r, n, i) {
				var o = {};
				Object.keys(n)
					.forEach((function(e) {
						o[e] = n[e]
					})), o.enumerable = !!o.enumerable, o.configurable = !!o.configurable, ("value" in o || o.initializer) && (o.writable = !0);
				o = r.slice()
					.reverse()
					.reduce((function(r, n) {
						return n(e, t, r) || r
					}), o), i && void 0 !== o.initializer && (o.value = o.initializer ? o.initializer.call(i) : void 0, o.initializer = void 0);
				void 0 === o.initializer && (Object.defineProperty(e, t, o), o = null);
				return o
			},
			assertThisInitialized: function(e) {
				if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
				return e
			},
			construct: o,
			createClass: function(e, r, n) {
				r && t(e.prototype, r);
				n && t(e, n);
				return e
			},
			defineProperty: function(e, t, r) {
				t in e ? Object.defineProperty(e, t, {
					value: r,
					enumerable: !0,
					configurable: !0,
					writable: !0
				}) : e[t] = r;
				return e
			},
			getPrototypeOf: r,
			inheritsLoose: function(e, t) {
				e.prototype = Object.create(t.prototype), e.prototype.constructor = e, n(e, t)
			},
			initializerDefineProperty: function(e, t, r, n) {
				if (!r) return;
				Object.defineProperty(e, t, {
					enumerable: r.enumerable,
					configurable: r.configurable,
					writable: r.writable,
					value: r.initializer ? r.initializer.call(n) : void 0
				})
			},
			isNativeFunction: u,
			isNativeReflectConstruct: i,
			setPrototypeOf: n,
			wrapNativeSuper: c
		})
	}
}

}));

大概率循环引用了

1赞

感谢大神,排查中!

比较要命,反复对比了,也没找到根源,恢复前一个tag,打包是正常

我前天也遇到过。 就修改了一个typescript的文件名。报循环依赖错误,最后还原之后再重新改又正常

玩cocos 果然是在不断得找BUG的过程,纠结我一天的问题源自一个小小的复选框——Toggle
我在ClickEvents里面绑定了一个点击事件。在事件中检索了下场景中的某些控件,并进行操作,整出的幺蛾子,并且在开发阶段屁事没有,直到编译后才爆出。而且不明不白的浪费宝贵人生。啥也不想说了。给开发组烧柱香去

2赞

该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。