2

I have the following problem using the ng-xi18n command:

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  

Does anyone have an idea how to fix this?

Node Version: v6.6.0

Angular: 2.0.0

Thanks for your time and help :)

EDIT: What worked for me is to uncomment the lines, that threw the error in the static.reflector.js. There is still an error, but also a new .xlf file. Just a temporary solution.

sevic
  • 879
  • 11
  • 36

3 Answers3

2

Remove all imports of RouterTestingModule and wait for the following issue to be fixed.

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

Michal Dymel
  • 4,312
  • 3
  • 23
  • 32
  • After removing the ```RouterTestingModule```, I ran into another error coming from primeng/datatables, maybe because it is not AOT ready yet. AOT seems to be very unstable... – Guntram Oct 06 '16 at 15:44
  • Yes, primeng is not AOT compatible yet: https://github.com/primefaces/primeng/pull/1004 I removed all primeng components temporarily... – Michal Dymel Oct 06 '16 at 15:49
0

Try to use node_modules/.bin/ng-xi18n -p src/tsconfig.json as it mentioned on github... It generates .xlf for me without any error.

Wolfson
  • 11
  • 3
0

Can you try creating a script in your package.json??

package.json

{
  ...,
  "scripts": {
    "i18n": "ng-xi18n",
    ...
  },
  ...
}

And run the script from the command line

$ npm run i18n
Eugenio Valeiras
  • 980
  • 1
  • 9
  • 30