Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angular/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 财产';使用服务器转换';不存在于类型';浏览器模块的类型(';)_Angular_Angular Universal_Angular2 Cli - Fatal编程技术网

Angular 财产';使用服务器转换';不存在于类型';浏览器模块的类型(';)

Angular 财产';使用服务器转换';不存在于类型';浏览器模块的类型(';),angular,angular-universal,angular2-cli,Angular,Angular Universal,Angular2 Cli,我使用角度通用1.0.0-alpha.universal.3 我已经使用angular universal cli创建了新的应用程序。 新的测试应用程序--通用 package.json { “名称”:“测试应用程序”, “版本”:“0.0.0”, “许可证”:“麻省理工学院”, “角cli”:{}, “脚本”:{ “开始”:“发球”, “lint”:“tslint\”src/***.ts\”, “测试”:“ung测试”, “pree2e”:“webdriver管理器更新--独立错误--geck

我使用角度通用1.0.0-alpha.universal.3

我已经使用angular universal cli创建了新的应用程序。 新的测试应用程序--通用

package.json { “名称”:“测试应用程序”, “版本”:“0.0.0”, “许可证”:“麻省理工学院”, “角cli”:{}, “脚本”:{ “开始”:“发球”, “lint”:“tslint\”src/***.ts\”, “测试”:“ung测试”, “pree2e”:“webdriver管理器更新--独立错误--gecko错误”, “e2e”:“量角器” }, “私人”:没错, “依赖项”:{ “@angular/common”:“2.2.3”, “@angular/compiler”:“2.2.3”, “@angular/core”:“2.2.3”, “@angular/forms”:“2.2.3”, “@angular/http”:“2.2.3”, “@角度/平台浏览器”:“^2.2.3”, “@angular/platform browser dynamic”:“2.2.3”, “@angular/platform server”:“^2.2.3”, “@angular/router”:“3.2.3”, “@ngx universal/state transfer”:“^4.0.1”, “angular2快速引擎”:“2.1.0-rc.1”, “angular2快闪消息”:“^1.0.8”, “angular2 jwt”:“^0.2.3”, “angular2平台节点”:“2.1.0-rc.1”, “angular2通用”:“2.1.0-rc.1”, “angular2通用多填料”:“2.1.0-rc.1”, “bcryptjs”:“^2.4.3”, “引导”:“^3.3.7”, “压缩”:“1.6.2”, “核心js”:“^2.4.1”, “cors”:“^2.8.4”, “express”:“^4.14.0”, “字体真棒”:“^4.7.0”, “jquery”:“^3.2.1”, “jsonwebtoken”:“^8.1.0”, “猫鼬”:“^4.13.1”, “passport”:“^0.4.0”, “护照jwt”:“^3.0.0”, “本地护照”:“^1.0.0”, “rxjs”:“5.0.0-beta.12”, “ts助手”:“^1.1.1”, “zone.js”:“^0.6.23” }, “依赖性”:{ “@angular/compiler cli”:“2.2.3”, “@types/jasmine”:“2.5.38”, “@types/node”:“^6.0.42”, “@types/body解析器”:“0.0.29”, “@types/compression”:“0.0.29”, “@types/cookie解析器”:“^1.3.29”, “@types/express”:“^4.0.29”, “@types/express服务静态核心”:“^4.0.29”, “@types/mime”:“0.0.28”, “@types/service static”:“^1.7.27”, “通用cli”:“1.0.0-alpha.universal.3”, “codelyzer”:“~2.0.0-beta.1”, “茉莉花芯”:“2.5.2”, “jasmine spec reporter”:“2.5.0”, “因果报应”:“1.2.0”, “karma chrome启动器”:“^2.0.0”, “karma cli”:“^1.0.1”, “因果报应茉莉”:“^1.0.2”, “因果报应重新映射伊斯坦布尔”:“^0.2.1”, “量角器”:“~4.0.13”, “ts节点”:“1.2.1”, “tslint”:“^4.0.2”, “类型脚本”:“~2.0.3” } } 我想在我的app.browser.module.ts文件中添加以下browserModule BrowserModule.withServerTransition({appId:'test app'})

添加此脚本后,我发现以下错误

Uncaught Error: Module build failed: Error: E:/projects/Angular2/test-app/src/app/app.browser.module.ts (32,19): Property 'withServerTransition' does not exist on type 'typeof BrowserModule'.) at _checkDiagnostics (E:\projects\Angular2\test-app\node_modules\@ngtools\webpack\src\loader.js:115:15) at E:\projects\Angular2\test-app\node_modules\@ngtools\webpack\src\loader.js:140:17 at at _checkDiagnostics (E:\projects\Angular2\test-app\node_modules\@ngtools\webpack\src\loader.js:115:15) at E:\projects\Angular2\test-app\node_modules\@ngtools\webpack\src\loader.js:140:17 at at Object.433 (http://localhost:4200/client.bundle.js:83:7) at __webpack_require__ (http://localhost:4200/inline.bundle.js:53:30) at Object.334 (http://localhost:4200/client.bundle.js:29:82) at __webpack_require__ (http://localhost:4200/inline.bundle.js:53:30) at Object.624 (http://localhost:4200/client.bundle.js:171:18) at __webpack_require__ (http://localhost:4200/inline.bundle.js:53:30) at webpackJsonpCallback (http://localhost:4200/inline.bundle.js:24:23) at http://localhost:4200/client.bundle.js:1:1 未捕获错误:模块生成失败:错误:E:/projects/Angular2/test app/src/app/app.browser.Module.ts(32,19):类型“typeof BrowserModule”上不存在属性“withServerTransition”。) 检查诊断(E:\projects\Angular2\test app\node\u modules\@ngtools\webpack\src\loader.js:115:15) 在E:\projects\Angular2\test app\node\u modules\@ngtools\webpack\src\loader.js:140:17 在 检查诊断(E:\projects\Angular2\test app\node\u modules\@ngtools\webpack\src\loader.js:115:15) 在E:\projects\Angular2\test app\node\u modules\@ngtools\webpack\src\loader.js:140:17 在 第433号物体(http://localhost:4200/client.bundle.js:83:7) 在需要的网页上(http://localhost:4200/inline.bundle.js:53:30) 在对象334处(http://localhost:4200/client.bundle.js:29:82) 在需要的网页上(http://localhost:4200/inline.bundle.js:53:30) 第624号目标(http://localhost:4200/client.bundle.js:171:18) 在需要的网页上(http://localhost:4200/inline.bundle.js:53:30) 在webpackJsonpCallback上(http://localhost:4200/inline.bundle.js:24:23) 在http://localhost:4200/client.bundle.js:1:1
链接:

我认为在angular 4中添加了WithServerTransition。如果您正在启动新项目,请升级到angular 4或5

v2文档


v4文档

您应该在问题中添加更多错误日志。它能更好地帮助你。 Uncaught Error: Module build failed: Error: E:/projects/Angular2/test-app/src/app/app.browser.module.ts (32,19): Property 'withServerTransition' does not exist on type 'typeof BrowserModule'.) at _checkDiagnostics (E:\projects\Angular2\test-app\node_modules\@ngtools\webpack\src\loader.js:115:15) at E:\projects\Angular2\test-app\node_modules\@ngtools\webpack\src\loader.js:140:17 at at _checkDiagnostics (E:\projects\Angular2\test-app\node_modules\@ngtools\webpack\src\loader.js:115:15) at E:\projects\Angular2\test-app\node_modules\@ngtools\webpack\src\loader.js:140:17 at at Object.433 (http://localhost:4200/client.bundle.js:83:7) at __webpack_require__ (http://localhost:4200/inline.bundle.js:53:30) at Object.334 (http://localhost:4200/client.bundle.js:29:82) at __webpack_require__ (http://localhost:4200/inline.bundle.js:53:30) at Object.624 (http://localhost:4200/client.bundle.js:171:18) at __webpack_require__ (http://localhost:4200/inline.bundle.js:53:30) at webpackJsonpCallback (http://localhost:4200/inline.bundle.js:24:23) at http://localhost:4200/client.bundle.js:1:1