Solvedangular ng-xi18n regression 4.0.2 -> 4.0.3

I'm submitting a ... (check one with "x")

[X] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see

Current behavior

The compiler fails with the following error:

ng-xi18n -p src/tsconfig-i18n.json

TypeError: Cannot read property 'toLowerCase' of null
at Extractor.serialize (.../node_modules/@angular/compiler-cli/src/extractor.js:44:32)
at .../node_modules/@angular/compiler-cli/src/extractor.js:32:33
at process._tickCallback (internal/process/next_tick.js:109:7)
at Module.runMain (module.js:606:11)
at run (bootstrap_node.js:393:7)
at startup (bootstrap_node.js:150:9)
at bootstrap_node.js:508:3
Extraction failed

Expected behavior

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

  • Angular version: 4.0.3
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: TypeScript 2.2.2

  • Node (for AoT issues): node --version = v6.10.2

12 Answers

✔️Accepted Answer

Easy to workaround: you have to specify the format with --i18nFormat (xlf, or xmb).
I'll work on the fix right now though.

Other Answers:

oh,./node_modules/.bin/ng-xi18n --i18nFormat=xmb
and perfect

because it's "xlf", not "xfl"

Wow, I'm so dumb... thanks!

For Windows Users:
"./node_modules/.bin/ng-xi18n" --i18nFormat=xlf

If the tsconfig.json TypeScript configuration file is located somewhere other than in the root folder, you must identify the path to it with the -p option:
"./node_modules/.bin/ng-xi18n" --i18nFormat=xlf -p path\to\tsconfig.json

Also follow the quotes order.

More Issues: