2017-08-01 80 views
0

當我們啓動多個項目時,ng2中的3個和ng4中的1個,獨立運行。一個項目也使用datatables.net。當試圖整合和升級到ng4時,我得到了這個錯誤。Angular 2 to 4 - Rxjs Subject.d.ts中的錯誤

  1. 登錄是1個應用組件,和其他人使用的login.html - 什麼是更好的方法?在編譯

    類 '主題'

  2. 錯誤錯誤地延伸的基類 '可觀測'。 屬性'lift'的類型不兼容。 類型'(operator:Operator)=> Observable'不可分配給類型'(operator:Operator)=> Observable'。 類型'Observable'不可分配爲鍵入'Observable'。 類型'T'不可分配給'R'類型。

    解決版本 [rxjs已升級到5.4.2 - 和降級到5.0.1]

rxjs是版本5.4.2

提具體問題後,應用程序的工作是

{ 
    "dependencies": { 
    "@angular/animations": "^4.1.1", 
    "@angular/common": "~4.3.2", 
    "@angular/compiler": "~4.3.2", 
    "@angular/core": "~4.3.2", 
    "@angular/forms": "~4.3.2", 
    "@angular/http": "~4.3.2", 
    "@angular/platform-browser": "~4.3.2", 
    "@angular/platform-browser-dynamic": "~4.3.2", 
    "@angular/router": "~4.3.2", 
    "alertify.js": "^1.0.12", 
    "angular-datatables": "^4.1.0", 
    "angular2-jwt": "^0.2.3", 
    "chart.js": "2.6.0", 
    "core-js": "^2.4.1", 
    "datatables.net": "^1.10.15", 
    "datatables.net-buttons": "2.2.0", 
    "datatables.net-buttons-dt": "1.3.1", 
    "datatables.net-colreorder": "1.3.3", 
    "datatables.net-colreorder-dt": "1.3.3", 
    "datatables.net-dt": "^1.10.15", 
    "datatables.net-responsive": "^2.1.1", 
    "datatables.net-responsive-bs": "^2.1.1", 
    "datatables.net-scroller": "1.4.2", 
    "file-loader": "^0.11.2", 
    "font-awesome": "^4.7.0", 
    "font-awesome-sass-loader": "^2.0.1", 
    "fullcalendar": "^3.1.0", 
    "jquery": "^3.2.1", 
    "moment": "^2.17.1", 
    "nanoscroller": "0.8.7", 
    "primeng": "4.0.0", 
    "quill": "^1.1.8", 
    "rxjs": "^5.0.1", 
    "ts-helpers": "^1.1.1", 
    "url-loader": "^0.5.9", 
    "zone.js": "^0.8.16" 
    }, 
    "devDependencies": { 
    "@angular/cli": "1.2.6", 
    "@angular/compiler-cli": "^4.3.2", 
    "@types/datatables.net": "^1.10.5", 
    "@types/datatables.net-buttons": "~1.1.2", 
    "@types/jasmine": "2.5.53", 
    "@types/jquery": "^2.0.43", 
    "@types/node": "^8.0.17", 
    "codelyzer": "~3.1.2", 
    "jasmine-core": "2.7.0", 
    "jasmine-spec-reporter": "4.1.1", 
    "karma": "1.7.0", 
    "karma-chrome-launcher": "^2.0.0", 
    "karma-cli": "^1.0.1", 
    "karma-jasmine": "^1.0.2", 
    "karma-remap-istanbul": "^0.6.0", 
    "node-sass": "^4.5.3", 
    "protractor": "~5.1.2", 
    "ts-node": "3.3.0", 
    "tslint": "^5.5.0", 
    "typescript": "~2.4.2", 
    "webpack": "3.4.1", 
    "webpack-dev-server": "2.6.1", 
    "webpack-merge": "^4.1.0" 
    } 
} 
+1

你研究過這個嗎?這很容易找到相關的問題:https://github.com/ReactiveX/rxjs/issues/2705 – jonrsharpe

+0

mmm它看起來像如果你沒有正確更新你所有的包 –

回答

0

此錯誤^ h伴隨着TypeScript的升級。

您應該升級所有軟件包。但有可能某些軟件包沒有進行最後的TypeScript修改。

然後,您可以對這些項目做出貢獻以使其兼容,否則應降級到支持TypeScript 4.1的最後一個Angular 4版本。

+0

Thanx jon,因爲新的ng和所有突然之間發生遷移,在某種程度上出現了升級錯誤。 –