Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack dev server proxy failing #6762

Closed
majames opened this issue May 10, 2019 · 5 comments
Closed

Webpack dev server proxy failing #6762

majames opened this issue May 10, 2019 · 5 comments

Comments

@majames
Copy link

majames commented May 10, 2019

Describe the bug

I am using storybook in full control mode and attempting to add a proxy to the webpack dev server for certain requests (as the backend API I'm querying is served off a different localhost port). This is failing to work.

To Reproduce

  1. Setup storybook in full control mode
  2. Mutate config with a devServer.proxy

Code snippets

// Note: storybook is served on PORT 9001
module.exports = async ({ config, mode }) => {
    config.devServer = {
      proxy: [
        {
          context: ["/requests"],
          target: "http://localhost"
        }
      ]
    };

    return config;
};

System:

  • MacOS
  • Framework: react
  • Version: 5.0.10

Apologies if this is a duplicate, however #208 and the other issues I found didn't seem to address this.

Any help would be much appreciated! 🙂

@majames
Copy link
Author

majames commented May 13, 2019

Any update here? 🙏

@stale
Copy link

stale bot commented Jun 3, 2019

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!

@stale stale bot added the inactive label Jun 3, 2019
@shilman
Copy link
Member

shilman commented Jun 3, 2019

@majames Sorry for the late reply. Have you tried running with the --debug-webpack CLI option?

@stale stale bot removed the inactive label Jun 3, 2019
@ndelangen
Copy link
Member

@majames You can use the middleware.js feature storybook has:
#435 (comment)

The feature still needs documentation. We could use your help with that.

We don't use webpack-dev-server directly. We use the devMiddleware:
https://github.com/webpack/webpack-dev-middleware

which doesn't support proxies

@majames
Copy link
Author

majames commented Jun 4, 2019

Thanks for following up @shilman and @ndelangen! I'll check it out and see whether it solves the problem for my use case! 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants