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 bypass not working in 1.15.0

See original GitHub issue

A webpack.config.js like this (mostly pulled from the docs)

var path = require("path");
module.exports = {
  entry: {
    app: ["./app/main.js"]
  },
  output: {
    path: path.resolve(__dirname, "build"),
    publicPath: "/assets/",
    filename: "bundle.js"
  },
  devServer: {
    proxy: {
      '/': {
        bypass: function(){
          return '/test.html';
        }
      }
    }
  }
};

works fine with webpack-dev-server@1.14.1, but after updating to 1.15.0, I get

$ node_modules/.bin/webpack-dev-server --content-base build/
/Users/claytonwatts/dev/test/node_modules/webpack-dev-server/node_modules/http-proxy-middleware/lib/config-factory.js:42
        throw new Error('[HPM] Missing "target" option. Example: {target: "http://www.example.org"}');
        ^

Error: [HPM] Missing "target" option. Example: {target: "http://www.example.org"}
    at Object.createConfig (/Users/claytonwatts/dev/test/node_modules/webpack-dev-server/node_modules/http-proxy-middleware/lib/config-factory.js:42:15)
    at new HttpProxyMiddleware (/Users/claytonwatts/dev/test/node_modules/webpack-dev-server/node_modules/http-proxy-middleware/lib/index.js:16:45)
    at module.exports (/Users/claytonwatts/dev/test/node_modules/webpack-dev-server/node_modules/http-proxy-middleware/index.js:4:12)
    at /Users/claytonwatts/dev/test/node_modules/webpack-dev-server/lib/Server.js:184:9
    at Array.forEach (native)
    at Object.Server.features.proxy (/Users/claytonwatts/dev/test/node_modules/webpack-dev-server/lib/Server.js:171:19)
    at Server.<anonymous> (/Users/claytonwatts/dev/test/node_modules/webpack-dev-server/lib/Server.js:274:20)
    at Array.forEach (native)
    at new Server (/Users/claytonwatts/dev/test/node_modules/webpack-dev-server/lib/Server.js:273:40)
    at Object.<anonymous> (/Users/claytonwatts/dev/test/node_modules/webpack-dev-server/bin/webpack-dev-server.js:183:1)

Looks like this is the commit that adds http-proxy-middleware.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:11 (6 by maintainers)

github_iconTop GitHub Comments

5reactions
seansfkelleycommented, Aug 25, 2016

Would it be possible to make a release now, just for this, since it’s a P0? A lot of my team members keep hitting this issue and wasting time debugging until they find this ticket.

4reactions
SpaceK33zcommented, Sep 1, 2016

This has been released as part of 1.15.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove matched `/api` path in Webpack proxy - Stack Overflow
I've added the rewrite to the docs. As bypass already passes the response as an argument to the registered handler, I'm unsure how...
Read more >
Bypass proxy and local intranet site exception not working
Hi, We have a locally hosted website in our organisation which loads when the proxy option in IE is unticked. When the proxy...
Read more >
BrowserType.LaunchOptions.Proxy (Playwright - javadoc.io
Short form myproxy.com:3128 is considered an HTTP proxy. bypass. public String bypass. Optional coma-separated domains to bypass proxy, for example ".com, ...
Read more >
App Mesh connectivity troubleshooting - AWS Documentation
This topic details common issues that you may experience with App Mesh connectivity. Unable to resolve DNS name for a virtual service. Symptoms....
Read more >
View Client 3.1 Proxy Bypass not working
I've installed my view 3.1 test lab. I've got a problem. The proxy bypass is not working. I've settings in the IE properties...
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