Skip to content

[error] Error: [HPM] Missing "target" option. Example: {target: "http://www.example.org"} #1269

Description

@jpsla94

Checks

Describe the bug (be clear and concise)

Hello,

I just upgraded from 3.0.5 to 3.0.7 to fix the latest vulnerabilities and now i getting the following exception bellow when i start front-end.

What can i do to fix this issue? Do i need to make changes to proxy config?

[error] Error: [HPM] Missing "target" option. Example: {target: "http://www.example.org"}     at verifyConfig (D:\example\example\ui-ag\node_modules\http-proxy-middleware\dist\configuration.js:7:15)     at new HttpProxyMiddleware (D:\example\example\ui-ag\node_modules\http-proxy-middleware\dist\http-proxy-middleware.js:138:42)     at createProxyMiddleware (D:\example\example\ui-ag\node_modules\http-proxy-middleware\dist\factory.js:6:28)     at getProxyMiddleware (D:\example\example\ui-ag\node_modules\webpack-dev-server\lib\Server.js:2303:18)     at Server.setupMiddlewares (D:\example\example\ui-ag\node_modules\webpack-dev-server\lib\Server.js:2353:12)     at Server.initialize (D:\example\example\ui-ag\node_modules\webpack-dev-server\lib\Server.js:1807:10)     at async Server.start (D:\example\example\ui-ag\node_modules\webpack-dev-server\lib\Server.js:3553:5)

Step-by-step reproduction instructions

1. ...
2. ...

Expected behavior (be clear and concise)

Project start successfully without exception trigger [error] Error: [HPM] Missing "target" option. Example: {target: "http://www.example.org"}

How is http-proxy-middleware used in your project?

`-- @angular-devkit/build-angular@20.3.29
  +-- http-proxy-middleware@3.0.5
  `-- webpack-dev-server@5.2.5 overridden
    `-- http-proxy-middleware@2.0.9

What http-proxy-middleware configuration are you using?

json file loaded through ng serve
{
 "/example/ui": {
   "target": "https://localhost:31079",
   "secure": false
 },
 "/example/api": {
   "target": "https://localhost:31079",
   "secure": false
 },
 "/example/rest": {
   "target": "https://localhost:31079",
   "secure": false
 }

What OS/version and node/version are you seeing the problem?

System:
    OS: Windows 10 10.0.20348
  Binaries:
    Node: 22.20.0
    npm: 11.6.2

Additional context (optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions