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.

--proxy-config option missing in new ng e2e

See original GitHub issue

Versions

cli 6.0.0-rc.4

Repro steps

  • npm i @angular/cli@next -g
  • ng new helloworld
  • add --proxy-config proxy.config.json to npm e2e script in package.json
  • cd helloworld
  • npm run e2e

Observed behavior

Unknown option: '--proxyConfig'

Desired behavior

ng e2e should continue to support a proxy config as before.

Mention any other details that might be useful (optional)

Works with ng serve.

Issue Analytics

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

github_iconTop GitHub Comments

10reactions
cyrilletuzicommented, Apr 13, 2018

Looks like ng e2e is now taking options directly from ng serve options. For info, you need to config your angular.json like this:

"serve": {
  "options": {
    "browserTarget": "appname:build",
    "proxyConfig": "proxy.conf.json"
   }
}
7reactions
Bartosz-D3Vcommented, May 4, 2018

Hi @cyrilletuzi I am not sure about latest version of Angular CLI, but in version 1.6.5 you can add a proxy to protractor by a command line like this: (package.json) "e2e": "ng e2e --proxy-config proxy.conf.json", Not sure why it was not documented in the wiki, it looks like a ‘natural’ way of adding a proxy - similar to the ng serve.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Angular migration (from 4 to 6) e2e --proxy-config not working
But when I try to execute the e2e tests like npm run e2e:tst5 it throws me the error: Unknown option: '--proxyConfig' . The...
Read more >
Building and serving Angular apps
This page discusses build-specific configuration options for Angular projects. Configuring application environmentslink. You can define different named ...
Read more >
Angular CLI - Quick Guide - Tutorialspoint
Angular CLI - ng new Command. This chapter explains the syntax, argument and options of ng new command along with an example.
Read more >
Angular CORS Guide 🛠️ Fixing errors - Dev-Academy.com
Simple Usage (Enable All CORS Requests); Advanced CORS options ... flag ng serve --proxy-config src/proxy.conf.json in the angular cli.
Read more >
angular/angular-cli - Gitter
there i have "start": "ng serve --host 0.0.0.0 --proxy-config proxy.conf.json", ... change the settings in project when we run ng new <PROJECT-NAME> command ......
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