Can't config proxy in configureWebpack
See original GitHub issueDescription
I am following config devServer proxy in vuecli
Steps to reproduce
- Add proxy to webpack config
configureWebpack: {
devServer: {
proxy: {
'/.netlify/functions/**': {
target: 'http://localhost:9000',
changeOrigin: true,
secure: false,
pathRewrite: {
'^/\\.netlify/functions': ''
}
}
}
},
},
Expected result
Should change host
Actual result
No change host
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Webpack dev server proxy settings can't customized ... - GitHub
Attempt to override proxy settings in vue.config.js with any setting that doesn't jive with prepareProxy's validators or createProxyEntry ...
Read more >Configure webpack-dev-server to play nice with different ...
I want to configure webpack-dev-server to proxy my existing site served from http://website.dev and proxy its' javascript assets which would be served from ......
Read more >devServer proxy(in vue.config.js) not working - Get Help
I encountered this problem, too. devServer proxy not working What should i do? vue.config.js exists in root dir of vue project.
Read more >DevServer - webpack
This option allows you to allowlist services that are allowed to access the dev server. webpack.config.js module.exports = { //... devServer: ...
Read more >Configuration - Nuxt
The axios-module cannot be used in nuxt.config.js . You will need to import axios and configure it again. Further configuration.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I wasn’t able to get the webpack devServer proxy to work, but I’m not 100% sure how the gridsome internals worked. Since it looks like express is used internally, I used a similar approach to creating a proxy in gatsby. This seemed to resolve the issue for me…
Steps:
yarn add -d http-proxy-middleware
ornpm install http-proxy-middleware --save-dev
gridsome.server.js
in the project root (same directory asgridsome.config.js
)I forgot to mention… I start the proxy on
9001
because it looks like something else is running on9000
… not sure what that is… 😛@BobDempsey
The
http-proxy-middleware
package has since been renamed theproxy
method tocreateProxyMiddleware
. You should now import the method like this: