Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ng xi18n fails silently #5129

Closed
ocombe opened this issue Mar 1, 2017 · 2 comments
Closed

ng xi18n fails silently #5129

ocombe opened this issue Mar 1, 2017 · 2 comments

Comments

@ocombe
Copy link
Contributor

ocombe commented Mar 1, 2017

OS?

Windows 10

Versions.

@angular/cli: 1.0.0-rc.0
node: 6.9.5
os: win32 x64
@angular/animations: 4.0.0-rc.1
@angular/common: 4.0.0-rc.1
@angular/compiler: 4.0.0-rc.1
@angular/compiler-cli: 4.0.0-rc.1
@angular/core: 4.0.0-rc.1
@angular/forms: 4.0.0-rc.1
@angular/http: 4.0.0-rc.1
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 4.0.0-rc.1
@angular/platform-browser-dynamic: 4.0.0-rc.1
@angular/platform-server: 4.0.0-rc.1
@angular/router: 4.0.0-rc.1
@angular/cli: 1.0.0-rc.0

Repro steps.

git clone https://github.com/StephenFluin/ames.git
cd ames
git checkout 64bde5ea0958a9bb325126a2e297e8c6631b0689
npm install
ng xi18n

---> no log, the command just ends after a while but nothing happened and you don't know why.

But if you manually call xi18n like this:

./node_modules/.bin/ng-xi18n -p src/tsconfig.json

You should see the following error:

Error: Could not mark an element as translatable inside a translatable section ("
                Type
                <select [(ngModel)]="newContent.type">
                    [ERROR ->]<option i18n>Presentation</option>
                    <option i18n>Blog Post</option>
            "): ames/src/app/developers/expert-form.component.ts@43:20
Could not mark an element as translatable inside a translatable section ("l)]="newContent.type">
                    <option i18n>Presentation</option>
                    [ERROR ->]<option i18n>Blog Post</option>
                    <option i18n>Other</option>
                </s"): ames/src/app/developers/expert-form.component.ts@44:20
Could not mark an element as translatable inside a translatable section ("18n>Presentation</option>
                    <option i18n>Blog Post</option>
                    [ERROR ->]<option i18n>Other</option>
                </select>
            </label>
"): ames/src/app/developers/expert-form.component.ts@45:20
    at ames\node_modules\@angular\compiler\bundles\compiler.umd.js:21695:25
    at process._tickCallback (internal/process/next_tick.js:103:7)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3
Extraction failed

Which in this case is because there is an error in a template with embedded i18n tags.

The log given by the failure.

There is no log, and that's the problem. Outputting errors to the terminal is important because it lets you fix it instead of wondering why it failed. Even the --verbose option doesn't output this error

@ocombe ocombe changed the title ng xi18n fails silently [i18n] ng xi18n fails silently Mar 1, 2017
@ocombe ocombe changed the title [i18n] ng xi18n fails silently ng xi18n fails silently Mar 1, 2017
@yechenchao
Copy link

I have the same problem too, the error log is very important.

cladera added a commit to cladera/angular-cli that referenced this issue Mar 4, 2017
Log i18n extraction errors

Fixes angular#5129
asnowwolf pushed a commit to asnowwolf/angular-cli that referenced this issue Apr 12, 2017
Log i18n extraction errors

Fixes angular#5129
Close angular#5223
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants