-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Description
π 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
- Create a new workspace with
ng new my-workspace --create-application false
- Inside this workspace, create new app with
ng generate application my-first-app
- Inside this application
C://.../my-workspace/projects/my-first-app
create aproxy.conf.json
with something like
{
"/api/*": {
"pathRewrite": {"^/api": ""},
"target": "http://localhost:3005",
"logLevel": "verbose"
}
}
- Inside workspace, add to
angular.json
:
{
...
"projects": {
...
"my-first-app": {
...
"serve": {
...
"options": {
"proxyConfig": "projects/my-first-app/proxy.conf.json"
},
...
}
...
}
...
}
...
}
- 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]