question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ng serve --configuration=en throws error

See original GitHub issue

### Versions


Output from: `ng --version`.

Angular CLI: 6.0.3
Node: 8.11.1
OS: darwin x64 (Sierra)
Angular: 6.0.2
... animations, cdk, common, compiler, compiler-cli, core, forms
... http, language-service, material, platform-browser
... platform-browser-dynamic, router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.6.3
@angular-devkit/build-angular     0.6.3
@angular-devkit/build-optimizer   0.6.3
@angular-devkit/core              0.6.3
@angular-devkit/schematics        0.6.3
@angular/cli                      6.0.3
@ngtools/webpack                  6.0.3
@schematics/angular               0.6.3
@schematics/update                0.6.3
rxjs                              6.1.0
typescript                        2.7.2
webpack                           4.8.3
    
[](url)

**### Repro steps**
Step 1:
I did add this to my angular.json file for i18n translation - it's based on the doc [here](https://angular.io/guide/i18n#merge-the-completed-translation-file-into-the-app): 

`...
"serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "demo:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "demo:build:production"
            },
            "en": {
                "aot": true,
                "outputPath": "dist/en/",
                "i18nFile": "src/assets/i18n/messages.en.xlf",
                "i18nFormat": "xlf",
                "i18nLocale": "en"
            }
          }
    },
.......`

Step 2:
Run the command: `ng serve --configuration=en --port 4900`

Step 3: Run/try other command: `for lang in en de; do ng build --output-path=dist/$lang --aot --prod --i18n-file=src/assets/i18n/messages.$lang.xlf --i18n-format=xlf --locale=$lang; done`


**### Observed behavior**
When I run the command: `ng serve --configuration=en --port 4900`, I get the following error:

> Schema validation failed with the following errors:
> Data path "" should NOT have additional properties(outputPath).

When I run the following: `for lang in en de; do ng build --output-path=dist/$lang --aot --prod --i18n-file=src/assets/i18n/messages.$lang.xlf --i18n-format=xlf --locale=$lang; done`, I get the following error:

> Unknown option: '--locale'

**### Desired behavior**

What would like to see implemented?
i18n Internazionalization  for different languages - in this case EN and DE

What is the usecase?
Serving the App in specific language based on the serve command mentioned above.

What did you expect to see?
Serving the App in specific language based on the serve command mentioned above.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
ganchuhangcommented, Jun 2, 2018

Any proper docs that guide us on ng serve with configurations in angular.json?

1reaction
chimungcommented, Jun 1, 2018

in my configuration of “qa” in serve. I reference by “name-of-your-project:build:qa”. It will get configuration of “qa” in build

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't run Angular app, ng serve throwing errors - Stack Overflow
The moment I use ng serve the errors show up. The application Fails to compile, but still runs in localhost. I am not...
Read more >
ng serve - Angular
Option Description Value Type Default Value ‑‑hmr Enable hot module replacement. boolean false ‑‑host Host to listen on. string localhost ‑‑open Opens the url in default...
Read more >
Identify and Fix Build and Deployment Errors in Your Angular ...
Usually, this can easily be fixed by stopping the ng serve process and re-running it because this allows the Webpack development server running ......
Read more >
Angular | IntelliJ IDEA Documentation - JetBrains
This configuration runs the ng serve command that launches the development server and starts your application in the development mode. A ...
Read more >
ng serve - slow as hell! : r/Angular2 - Reddit
node_modules/@angular/cli/bin/ng serve ... This throws the error “configuration development not set in the workspace”.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found