[HPM] Error occurred while trying to proxy request / from localhost:3000 to http://localhost:8080 on fresh Debian Stretch 4.8.0 install
See original GitHub issueWhen running npm run dev
after npm install
I expect to navigate to localhost:3000 and see the starter page, instead I see Error occured while trying to proxy to: localhost:3000/
and in logs
10:44:07 PM webpack.1 | [HPM] Error occurred while trying to proxy request /favicon.ico from localhost:3000 to http://localhost:8080 (ECONNREFUSED) (https:
10:44:07 PM webpack.1 | > //nodejs.org/api/errors.html#errors_common_system_errors)
Issue Analytics
- State:
- Created 7 years ago
- Comments:45 (1 by maintainers)
Top Results From Across the Web
Error [HPM] Error occurred while trying to proxy request / from ...
First, your developMiddleware setup points to http://localhost:4000 , but your server ( server.js ) by default runs at http://localhost:3000 .
Read more >How to fix error occurred while trying to proxy request
1. Check which IP version is the server using · 2. Modify your code · 3. Change webpack proxy configuration · 4. Modify...
Read more >Fix Error Occurred While Trying to Proxy Request - TechCult
An error occurred while typing to proxy request is a common error that developers come across while writing and publishing codes.
Read more >Django : React Proxy error: Could not proxy request /api
Django : React Proxy error : Could not proxy request /api/ from localhost:3000 to http://localhost:8000 (ECONNREFUSED) [ Beautify Your ...
Read more >Sage 10 Proxy Localhost:3000 Not Working - Roots Discourse
Hello, I am running a new installation of Trellis on Ubuntu 20.10 and and am ... Visiting localhost:3000 results in: Error occurred while...
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
@saikat no necesarilly, it s just common bug in error log. I tried to proxy from 9000, to 8081 and saw the same error saying it can not proxy to 9000… makes no sense.
You probably need to rewrite your webpack proxy config:
replace localhost with [::1]. like so: ‘http://[::1]:3000’
this works for me:
below code comes from webpack configuration file - section devSever (as seen below) https://webpack.github.io/docs/webpack-dev-server.html#proxy
one wildcard, or double, with ‘secure’ or ‘changeOrigin’ - doesnt matter. [::1] is the game changer.
Wider discussion and more options here: https://github.com/webpack/webpack-dev-server/issues/793
Good luck!
For me the problem was the HTTPS, not HTTP, and worked with changeOrigin, solve it like this:
{ “/api”: { “target”: “https://localhost:12345”, “secure”: false, “changeOrigin”: true } }