gpt4 book ai didi

javascript - 未捕获的语法错误 : Strict mode code may not include a with statement

转载 作者:行者123 更新时间:2023-12-01 14:50:52 25 4
gpt4 key购买 nike

我最近更新到 Angular v9,我收到以下错误:

Uncaught SyntaxError: Strict mode code may not include a with statement



这发生在以下文件中:
./node_modules/@angular/animations/__ivy_ngcc__/fesm2015/animations.js
根据文件中的注释,这是一个 Angular v9 文件:

/** * @license Angular v9.0.0 * (c) 2010-2020 Google LLC. https://angular.io/ * License: MIT */



这发生在这里, with陈述:
module.exports = {
Window_run: function _run(code, file) {
if (file) code += '\n//@ sourceURL=' + file;
with(this) eval(code);
},

此行上方有一条评论:

/* Domino uses sloppy-mode features (in particular, with) for a few * minor things. This file encapsulates all the sloppiness; every * other module should be strict. / / jshint strict: false / / jshint evil: true / / jshint -W085 */

最佳答案

我正在寻找类似问题的解决方案。升级到 Angular 9 破坏了我的应用程序。经过大量试验和错误this helped me .

只需注释掉或从 main.ts 中删除以下行(由升级过程添加):

export { renderModule, renderModuleFactory } from '@angular/platform-server';

关于javascript - 未捕获的语法错误 : Strict mode code may not include a with statement,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60114758/

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