2016-09-28 67 views
2

我必須使用NG-xi18n命令如下問題:角2 i18n的提取失敗的錯誤

c:\Users\Documents\bptt_webclient>node_modules\.bin\ng-xi18n                              
Error: parameters received {"filePath":"c:/Users/Documents/bptt_webclient/node_modules/@angular/common/src/location/location.d.ts","name":"Location"} which is not a StaticSymbo 
l                                                
    at StaticReflector.parameters (c:\Users\Documents\bptt_webclient\node_modules\@angular\compiler-cli\src\static_reflector.js:92:19)           
    at CompileMetadataResolver.getDependenciesMetadata (c:\Users\Documents\bptt_webclient\node_modules\@angular\compiler\bundles\compiler.umd.js:14317:56)      
    at CompileMetadataResolver.getTypeMetadata (c:\Users\Documents\bptt_webclient\node_modules\@angular\compiler\bundles\compiler.umd.js:14282:28)        
    at c:\Users\Documents\bptt_webclient\node_modules\@angular\compiler\bundles\compiler.umd.js:14425:43                   
    at Array.forEach (native)                                         
    at CompileMetadataResolver.getProvidersMetadata (c:\Users\Documents\bptt_webclient\node_modules\@angular\compiler\bundles\compiler.umd.js:14405:21)       
    at c:\Users\Documents\bptt_webclient\node_modules\@angular\compiler\bundles\compiler.umd.js:14412:43                   
    at Array.forEach (native)                                         
    at CompileMetadataResolver.getProvidersMetadata (c:\Users\Documents\bptt_webclient\node_modules\@angular\compiler\bundles\compiler.umd.js:14405:21)       
    at CompileMetadataResolver.getNgModuleMetadata (c:\Users\Documents\bptt_webclient\node_modules\@angular\compiler\bundles\compiler.umd.js:14164:60)       
Extraction failed 

有沒有人有一個想法如何解決這一問題?

節點版本:V6.6.0

角:2.0.0

感謝您的時間和幫助:)

編輯:什麼工作對我來說是取消對線,拋出的在static.reflector.js錯誤。仍然有一個錯誤,但也是一個新的.xlf文件。只是一個臨時解決方案

回答

0

嘗試使用node_modules/.bin/ng-xi18n -p src/tsconfig.json,因爲它在github上提到...它爲我生成.xlf沒有任何錯誤。

+0

我沒有工作,還是同樣的錯誤消息 – sevic

+0

你設法解決這個問題?我現在遇到同樣的問題 –

+0

我也面臨同樣的問題! :) – Ben

1

刪除所有進口的RouterTestingModule並等待以下問題被修復。

https://github.com/angular/angular/issues/11276

+0

刪除'''RouterTestingModule'''後,我遇到了來自primeng/datatables的另一個錯誤,可能是因爲它尚未準備好AOT。 AOT似乎非常不穩定... – Guntram

+0

是的,primeng不是AOT兼容的:https://github.com/primefaces/primeng/pull/1004我暫時刪除了所有的primeng組件... –