gpt4 book ai didi

javascript - Angular 2 不适用于 MS Edge

转载 作者:数据小太阳 更新时间:2023-10-29 06:10:15 26 4
gpt4 key购买 nike

当我在 MS Edge 中加载我的应用程序时遇到脚本错误。然而 Firefox、Chrome、IE11 都可以工作,除了 Edge...

这是控制台的屏幕截图:

enter image description here

看这里:

HTML1300: Navigation occurred.
localhost:23752
SCRIPT65535: Argument not optional
zone.js (556,13)
SCRIPT257: Could not complete the operation due to error 80020101.
localhost:23752 (1,1)
Unhandled Promise rejection: 'Zone' is undefined ; Zone: <root> ; Task: Promise.then ; Value: ReferenceError: 'Zone' is undefined ReferenceError: 'Zone' is undefined
at NgZoneImpl (eval code:8749:13)
at NgZone (eval code:8902:13)
at PlatformRef_.prototype._bootstrapModuleFactoryWithZone (eval code:9447:17)
at Anonymous function (eval code:9489:50)
at ZoneDelegate.prototype.invoke (http://localhost:23752/node_modules/zone.js/dist/zone.js:190:13)
at Zone.prototype.run (http://localhost:23752/node_modules/zone.js/dist/zone.js:85:17)
at Anonymous function (http://localhost:23752/node_modules/zone.js/dist/zone.js:451:17)
at ZoneDelegate.prototype.invokeTask (http://localhost:23752/node_modules/zone.js/dist/zone.js:223:17)
at Zone.prototype.runTask (http://localhost:23752/node_modules/zone.js/dist/zone.js:125:21)
at drainMicroTaskQueue (http://localhost:23752/node_modules/zone.js/dist/zone.js:357:25)
zone.js (344,13)
"Unhandled Promise rejection:"
"'Zone' is undefined"
"; Zone:"
"<root>"
"; Task:"
"Promise.then"
"; Value:"
{
[functions]: ,
__proto__: { },
description: "'Zone' is undefined",
message: "'Zone' is undefined",
name: "ReferenceError",
number: -2146823279,
stack: "ReferenceError: 'Zone' is undefined
at NgZoneImpl (eval code:8749:13)
at NgZone (eval code:8902:13)
at PlatformRef_.prototype._bootstrapModuleFactoryWithZone (eval code:9447:17)
at Anonymous function (eval code:9489:50)
at ZoneDelegate.prototype.invoke (http://localhost:23752/node_modules/zone.js/dist/zone.js:190:13)
at Zone.prototype.run (http://localhost:23752/node_modules/zone.js/dist/zone.js:85:17)
at Anonymous function (http://localhost:23752/node_modules/zone.js/dist/zone.js:451:17)
at ZoneDelegate.prototype.invokeTask (http://localhost:23752/node_modules/zone.js/dist/zone.js:223:17)
at Zone.prototype.runTask (http://localhost:23752/node_modules/zone.js/dist/zone.js:125:21)
at drainMicroTaskQueue (http://localhost:23752/node_modules/zone.js/dist/zone.js:357:25)"
}
"ReferenceError: 'Zone' is undefined
at NgZoneImpl (eval code:8749:13)
at NgZone (eval code:8902:13)
at PlatformRef_.prototype._bootstrapModuleFactoryWithZone (eval code:9447:17)
at Anonymous function (eval code:9489:50)
at ZoneDelegate.prototype.invoke (http://localhost:23752/node_modules/zone.js/dist/zone.js:190:13)
at Zone.prototype.run (http://localhost:23752/node_modules/zone.js/dist/zone.js:85:17)
at Anonymous function (http://localhost:23752/node_modules/zone.js/dist/zone.js:451:17)
at ZoneDelegate.prototype.invokeTask (http://localhost:23752/node_modules/zone.js/dist/zone.js:223:17)
at Zone.prototype.runTask (http://localhost:23752/node_modules/zone.js/dist/zone.js:125:21)
at drainMicroTaskQueue (http://localhost:23752/node_modules/zone.js/dist/zone.js:357:25)"

Error: Uncaught (in promise): ReferenceError: 'Zone' is undefined
zone.js (346,9)
{
[functions]: ,
__proto__: { },
description: "Uncaught (in promise): ReferenceError: 'Zone' is undefined",
message: "Uncaught (in promise): ReferenceError: 'Zone' is undefined",
name: "Error",
promise: { },
rejection: { },
stack: "Error: Uncaught (in promise): ReferenceError: 'Zone' is undefined
at resolvePromise (http://localhost:23752/node_modules/zone.js/dist/zone.js:418:25)
at Anonymous function (http://localhost:23752/node_modules/zone.js/dist/zone.js:454:17)
at ZoneDelegate.prototype.invokeTask (http://localhost:23752/node_modules/zone.js/dist/zone.js:223:17)
at Zone.prototype.runTask (http://localhost:23752/node_modules/zone.js/dist/zone.js:125:21)
at drainMicroTaskQueue (http://localhost:23752/node_modules/zone.js/dist/zone.js:357:25)
at g (http://localhost:23752/node_modules/core-js/client/shim.min.js:8:10014)
at Anonymous function (http://localhost:23752/node_modules/core-js/client/shim.min.js:8:10138)
at k (http://localhost:23752/node_modules/core-js/client/shim.min.js:8:14293)",
task: {
[functions]: ,
__proto__: { },
cancelFn: null,
data: undefined,
runCount: 1,
scheduleFn: undefined,
source: "Promise.then",
type: "microTask",
zone: { }
},
zone: {
[functions]: ,
__proto__: { },
_name: "<root>",
_parent: null,
_properties: { },
_zoneDelegate: { },
name: "<root>",
parent: null
}
}

我还注意到第 556 行 zone.js 中的 Argument not optional

 if (NativePromise) {
patchThen(NativePromise);
if (typeof global['fetch'] !== 'undefined') {
var fetchPromise = global['fetch']();
// ignore output to prevent error;
fetchPromise.then(function () { return null; }, function () { return null; });
if (fetchPromise.constructor != NativePromise) {
patchThen(fetchPromise.constructor);
}
}
}

具体行是:

var fetchPromise = global['fetch']();

然后是令人担忧的错误:“由于错误 80020101,无法完成操作”

这个问题有很多解决方案,删除双斜线注释,或者脚本标签内的 html 注释,但都没有用。

Error 80020101

有人知道吗?

我使用的是最新的 MS Insider 预览版 Edge 39.14915。

最佳答案

我通过从 0.6.21 => 0.6.25 更新 zone.js 解决了这个问题,在 CDN 上可用这里 https://unpkg.com/zone.js@0.6.25?main=browser或者来自他们的 github 存储库。

关于javascript - Angular 2 不适用于 MS Edge,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39540851/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com