Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Dev-server error after setting proxy.conf.json loglevel to "verbose"Β #22969

@i3ene

Description

@i3ene

🐞 Bug report

Command

  • new
  • build
  • serve
  • test
  • e2e
  • generate
  • add
  • update
  • lint
  • extract-i18n
  • run
  • config
  • help
  • version
  • doc

Is this a regression?

Yes, the previous version in which this bug was not present was: Angular v12

Description

As of the new WebPack version in Angular v13 I changed the logLevel inside my proxy.conf.json from debug to verbose.
Since then I receive on ng serve:

An unhandled exception occured: Dev-server address info is not defined.

To Note

I work inside an Angular "workspace", so my apps are inside the "projects" folder.

Also (when I remove logLevel, so that the Dev-Server starts) I receive duplicate requests on my API end.
Some of my URLs go to /api/proxy/my-service and after WebPack proxy it should look like http://localhost:3005/proxy/my-service. But I also receive a second request on http://localhost:3005/my-service? Does it have a problem with the keyword "proxy" inside URLs?

πŸ”¬ Minimal Reproduction

  1. Create a new workspace with ng new my-workspace --create-application false
  2. Inside this workspace, create new app with ng generate application my-first-app
  3. Inside this application C://.../my-workspace/projects/my-first-app create a proxy.conf.json with something like
{
  "/api/*": {
    "pathRewrite": {"^/api": ""},
    "target": "http://localhost:3005",
    "logLevel": "verbose"
  }
}
  1. Inside workspace, add to angular.json:
{
 ...
 "projects": {
  ...
  "my-first-app": {
   ...
   "serve": {
    ...
    "options": {
            "proxyConfig": "projects/my-first-app/proxy.conf.json"
    },
    ...
   }
  ...
  }
 ...
 }
...
}
  1. Run ng serve my-first-app and observe

πŸ”₯ Exception or Error


[error] Error: Dev-server address info is not defined.
    at C:\Users\...\my-workspace\node_modules\@angular-devkit\build-webpack\src\webpack-dev-server\index.js:63:27

🌍 Your Environment


Angular CLI: 13.3.2
Node: 16.14.2
Package Manager: npm 8.5.0
OS: win32 x64

Angular: 13.3.2
... animations, cdk, cli, common, compiler, compiler-cli, core    
... forms, material, platform-browser, platform-browser-dynamic   
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1303.2
@angular-devkit/build-angular   13.3.2
@angular-devkit/core            13.3.2
@angular-devkit/schematics      13.3.2
@angular/flex-layout            13.0.0-beta.38
@schematics/angular             13.3.2
ng-packagr                      13.3.0
rxjs                            7.5.5
typescript                      4.6.3

Output of npm ls webpack-dev-server:


[email protected] C:\Users\...\my-workspace
└─┬ @angular-devkit/[email protected]
  β”œβ”€β”¬ @angular-devkit/[email protected]
  β”‚ └── [email protected] deduped
  └── [email protected]

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions