- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我在 angular 项目中升级了我的 package.json。从 Angular 6 迁移到 7。当我尝试构建时,我在控制台中看到了这个错误。
错误 TS2563:包含的函数或模块主体对于控制流分析来说太大。
这是我的新 package.json
{
"name": "e-case-prototype",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng serve --proxy-config proxy.conf.json --source-map=false",
"build": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build",
"build-prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --prod",
"build-prod-aot-disabled": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --prod --aot false --build-optimizer false",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular-devkit/build-angular": "^0.13.9",
"@angular/animations": "7.2.15",
"@angular/cdk": "7.3.7",
"@angular/common": "7.2.15",
"@angular/compiler": "7.2.15",
"@angular/core": "7.2.15",
"@angular/flex-layout": "^7.0.0-beta.24",
"@angular/forms": "7.2.15",
"@angular/http": "7.2.15",
"@angular/material": "7.3.7",
"@angular/platform-browser": "7.2.15",
"@angular/platform-browser-dynamic": "7.2.15",
"@angular/router": "7.2.15",
"@ngx-translate/core": "^11.0.1",
"@ngx-translate/http-loader": "^4.0.0",
"@swimlane/ngx-charts": "11.1.0",
"@types/moment-timezone": "^0.5.12",
"angular-calendar": "^0.27.8",
"angular-draggable-droppable": "^4.3.0",
"angular-in-memory-web-api": "0.8.0",
"angular-resizable-element": "^3.2.4",
"chart.js": "^2.8.0",
"classlist.js": "^1.1.20150312",
"codelyzer": "^5.0.1",
"core-js": "^2.5.7",
"date-fns": "^1.30.1",
"hammerjs": "2.0.8",
"intl": "1.2.5",
"jquery": "^3.4.1",
"luxon": "^1.15.0",
"moment": "2.24.0",
"moment-timezone": "^0.5.25",
"ng-dynamic-component": "^4.0.3",
"ng2-charts": "2.2.3",
"ng2-dnd": "5.0.2",
"ngx-captcha": "^6.4.0",
"ngx-color-picker": "7.5.0",
"ngx-cookie-service": "2.2.0",
"ngx-material-timepicker": "^3.1.0",
"ngx-quill": "^5.1.0",
"npm-check": "^5.9.0",
"perfect-scrollbar": "1.4.0",
"prismjs": "1.16.0",
"quill": "^1.3.6",
"rxjs": "^6.5.2",
"rxjs-compat": "^6.5.2",
"systemjs": "^3.1.6",
"tslib": "^1.9.3",
"web-animations-js": "^2.3.1",
"zone.js": "0.9.1"
},
"devDependencies": {
"@angular/cli": "7.3.9",
"@angular/compiler-cli": "7.2.15",
"@angularclass/hmr": "2.1.3",
"@types/jasmine": "3.3.12",
"@types/jasminewd2": "2.0.6",
"@types/node": "12.0.2",
"jasmine-core": "3.4.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "4.1.0",
"karma-chrome-launcher": "2.2.0",
"karma-coverage-istanbul-reporter": "2.0.5",
"karma-jasmine": "2.0.1",
"karma-jasmine-html-reporter": "1.4.2",
"protractor": "5.4.2",
"ts-node": "8.1.0",
"tslint": "5.16.0",
"typescript": "3.1.6",
"webpack-bundle-analyzer": "3.3.2"
}
}
这是可以正常工作的旧 package.json
{
"name": "e-case-prototype",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng serve --proxy-config proxy.conf.json --source-map=false",
"build": "ng build",
"build-prod": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --prod",
"build-prod-aot-disabled": "node --max_old_space_size=5048 ./node_modules/@angular/cli/bin/ng build --prod --aot false --build-optimizer false",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular-devkit/build-angular": "^0.6.3",
"@angular/animations": "6.0.2",
"@angular/cdk": "6.0.2",
"@angular/common": "6.0.2",
"@angular/compiler": "6.0.2",
"@angular/core": "6.0.2",
"@angular/flex-layout": "5.0.0-beta.14",
"@angular/forms": "6.0.2",
"@angular/http": "6.0.2",
"@angular/material": "6.0.2",
"@angular/platform-browser": "6.0.2",
"@angular/platform-browser-dynamic": "6.0.2",
"@angular/router": "6.0.2",
"@ngx-translate/core": "^10.0.1",
"@ngx-translate/http-loader": "^3.0.1",
"@swimlane/ngx-charts": "8.0.1",
"@types/moment-timezone": "^0.5.11",
"angular-calendar": "0.25.2",
"angular-draggable-droppable": "^3.0.0",
"angular-in-memory-web-api": "0.6.0",
"angular-resizable-element": "^3.0.0",
"classlist.js": "^1.1.20150312",
"codelyzer": "^4.3.0",
"core-js": "2.5.6",
"hammerjs": "2.0.8",
"intl": "1.2.5",
"jquery": "^3.3.1",
"moment": "2.22.1",
"moment-timezone": "^0.5.23",
"ng-dynamic-component": "^3.0.0",
"ng2-charts": "1.6.0",
"ng2-dnd": "5.0.2",
"ngx-captcha": "^5.0.3",
"ngx-color-picker": "6.1.0",
"ngx-cookie-service": "1.0.10",
"ngx-material-timepicker": "^2.13.0",
"ngx-quill": "^3.1.0",
"npm-check": "^5.7.1",
"perfect-scrollbar": "1.3.0",
"prismjs": "1.14.0",
"quill": "^1.3.6",
"rxjs": "^6.1.0",
"rxjs-compat": "^6.1.0",
"systemjs": "^0.21.4",
"tslib": "^1.9.2",
"web-animations-js": "^2.3.1",
"zone.js": "0.8.26"
},
"devDependencies": {
"@angular/cli": "6.0.3",
"@angular/compiler-cli": "6.0.2",
"@angularclass/hmr": "2.1.3",
"@types/jasmine": "2.8.7",
"@types/jasminewd2": "2.0.3",
"@types/node": "10.1.2",
"jasmine-core": "3.1.0",
"jasmine-spec-reporter": "4.2.1",
"karma": "2.0.2",
"karma-chrome-launcher": "2.2.0",
"karma-coverage-istanbul-reporter": "2.0.0",
"karma-jasmine": "1.1.2",
"karma-jasmine-html-reporter": "1.1.0",
"protractor": "5.3.2",
"ts-node": "6.0.3",
"tslint": "5.10.0",
"typescript": "^2.7.2",
"webpack-bundle-analyzer": "2.13.0"
}
}
我已经尝试升级到不同的 typescript 版本。我受到 Angular 的限制,因为版本必须在 3.1.1 和 3.3 之间
代码是在以前的 ^2.7.2 typescript 版本上编译的
最佳答案
这个函数有多大?根据this reference file in the TypeScript source code在函数中包含超过 10,000 个节点后,预计会出现此错误。
==== tests/cases/compiler/largeControlFlowGraph.ts (1 errors) ====
// The control flow graph for the following statement block is 10000 nodes deep. Check that
// we gracefully handle this, possibly by issuing an error.
const data = [];
~~~~~
!!! error TS2563: The containing function or module body is too large for control flow analysis.
data[0] = 0;
data[0] = 0;
data[0] = 0;
//they do this 10000 more times...
data[0] = 0;
data[0] = 0;
关于angular - 错误 TS2563 : The containing function or module body is too large for control flow analysis,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56298571/
Yii::$app->runAction('new_controller/new_action', $params); 我相信这可以用来从另一个 Controller 调用 Controller Ac
这个问题类似于 this ,但我需要访问父成员(不是控制)。我不知道是否可以不使用依赖注入(inject)。 例如,我有一个父级,有一个成员调用用户,我需要从子 Controller 访问用户。 最佳
我有包含 2 个布局的根布局:- 选项面板- 绘制区域 我正在尝试的是访问 OptionsPaneController 中的 DrawAreaController 以调用其绘制方法。下面是 Optio
我的应用程序的 View Controller 层次结构设置如下: UIViewController | UITabBarController | UINavigationCo
我的应用程序的 View Controller 层次结构设置如下: UITabBarController | UINavigationController | | |
当我第一次为我目前在 Storyboard 中开发的应用程序创建基础布局时,我分两步完成: 选择我的 View Controller 并使用 Editor->Embed In->Navigation
设计要求: 显示用户可以选择的项目列表 选择一个项目后,使用后退按钮将用户带到一个新 View 。新 View 应在底部包含第一个屏幕中不存在的选项卡列表 单击选项卡中的项目时,应出现一个带有后退按钮
将父 Controller 设置为“parentCtrl as vm”,并将子 Controller 设置为“childCtrl as vmc”,以避免名称冲突,并且效果良好。 如何在子 Contro
我已经阅读了一些答案,例如关闭当前的 ViewController,但我的情况有所不同,因为我正在展示另一个 ViewController。 虽然我无法访问它的属性,但此代码显示了带有导航 Contr
如我所见,如果我们要实例化一个Model(例如,名为Post),我们只需调用: $post = new Post(); 现在,我还想实例化一个Controller(例如,名为Post,并为此 Cont
我已经疯狂地在整个网络上搜索解决我的问题的方法,但目前还没有。我的问题是我必须检查是否在 HTTP 请求中获得特定文本,该请求在一个 while 循环中,如果我这样做了,那么我应该离开循环并继续线程,
我想用this.get('controllers.pack.query');要得到App.PackQueryController在 App.PackController ,但失败了。 我认为问题是 E
我刚开始使用 Laravel。当我使用 codeigniter 或 zend 框架时,我可以将我的 Controller 组织到一个单独的目录中。例如,我可以创建“user/permission.ph
在 emberjs 前 2 我们可以从另一个 Controller 访问 Controller 或 Controller 中的任何方法 以下方式: App.get('router').get('nav
这可能是非常简单的实现,但我是 iOS 编程的新手,我似乎被卡住了。 所以,基本上,我有一个选项卡式应用程序。我决定除了标签栏之外还需要一个导航栏。为此,我放置了标签栏 Controller ,然后添
我有这个列表 Controller , define([ 'jquery', 'app' ], function ($,app) { app.controller("ListC
我有 3 个 Controller :RootController、FirstController 和 SecondController。我想从 RootController -> FirstCont
我有以下 Controller : /controllers/api/base_controller.rb /controllers/api/v1/articles_controller.rb 当为文
我是 Angular JS 的新手,尝试在另一个 Controller 中调用一个 Controller ,但出现以下错误。 ionic.bundle.js:21157 TypeError: $con
我有一个标签栏 Controller 和它的 3 个 child ,我还有另一个 View ,我制作了一个从 child 到 View Controller 的自定义转场,还有一个从 View Con
我是一名优秀的程序员,十分优秀!