Repository navigation
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-appcreate aproxy.conf.jsonwith 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-appand 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]
Activity
alan-agius4 commentedon Apr 11, 2022
I looks like we are not emitting proxy config errors.
verboseis not a valid value forlogLevel.https://github.com/chimurai/http-proxy-middleware#options
i3ene commentedon Apr 11, 2022
Argh, sorry, my bad.
But it seems there is another issue (in general) with logging of proxy? Since
"logLevel": "debug"doesn't log anything in console. Not even withng serve my-first-app --verbosealan-agius4 commentedon Apr 11, 2022
I do see the logs from http-proxy-middleware being printed correctly.
Edit: I see that debug logs are not displayed because we never turn on https://webpack.js.org/configuration/other-options/#debug
i3ene commentedon Apr 11, 2022
Yeah, I wondered, because I also saw it being set up but did not see the active proxy output.
That's where I got
verbosefrom, was a little lost when I looked into webpack.fix(@angular-devkit/build-webpack): emit devserver setup errors
fix(@angular-devkit/build-webpack): emit devserver setup errors
angular-automatic-lock-bot commentedon May 12, 2022
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.