Open LoganDark opened 3 years ago
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.
This issue still occurs.
You can force create-react-app
to bind to an ipv6 address like this:
$ HOST=::1 npm start
(to be clear, ::1
is the ipv6 loopback, i.e. localhost
)
however, ideally create-react-app
should bind to all addresses / IP classes that localhost
resolves to.
I will note that on pure Linux (i.e. not WSL) the issue is slightly different but @LoganDark please let us know if the above helps.
You can force
create-react-app
to bind to an ipv6 address like this:$ HOST=::1 npm start
(to be clear,
::1
is the ipv6 loopback, i.e.localhost
)however, ideally
create-react-app
should bind to all addresses / IP classes thatlocalhost
resolves to.
It's already binding to both addresses, it's just that the IPv6 address always returns Cannot GET /
I'll try it in a bit
This issue doesn't seem to have been addressed at all and it is leading to problems now that GitHub has moved the default version of Node.js to 18 (see for instance https://github.com/jeffbski/wait-on/issues/137.)
This would be using create-react-app 5.0.1
.
$ npm ls
cra@0.1.0
├── @testing-library/jest-dom@5.16.5
├── @testing-library/react@13.4.0
├── @testing-library/user-event@13.5.0
├── react-dom@18.2.0
├── react-scripts@5.0.1
├── react@18.2.0
└── web-vitals@2.1.4
After setting up cra using
npx create-react-app cra
on Windows 11 with Node.js 18.14.2
and running
npm start
the IPv6 loopback address ::1
does not respond:
$ curl -I http://[::1]:3000
curl: (7) Failed to connect to ::1 port 3000 after 2042 ms: Couldn't connect to server
http://localhost:3000
and http://127.0.0.1:3000
return with
HTTP/1.1 200 OK
if nothing works then using proxy with nginx works
if nothing works then using proxy with nginx works
What do you mean by "using proxy with nginx" - is that an option/flag somewhere now? Or do you mean setting it up manually?
@LoganDark you can setup an nginx server with in configuration ports opened to ipv6 and ipv4 and the proxy points to 127.0.0.1:3000; see this
@LoganDark you can setup an nginx server with in configuration ports opened to ipv6 and ipv4 and the proxy points to 127.0.0.1:3000; see this
I know what a reverse proxy is. I was just asking if you were talking about a specific setting, or setting up an entire nginx installation just to use this dev server. IMHO I think that's a bit much, but if you run dev servers for a living then I guess it is fine
Describe the bug
The Webpack dev server does not properly handle IPv6 requests. It responds with
Cannot GET /
.Did you try recovering your dependencies?
I don't use multiple package managers
Which terms did you search for in User Guide?
ipv6
,ipv4
Environment
(WSL 1 on Windows 10 Home 2004 build 19041.928)
Steps to reproduce
npm start
[::1]:3000
Cannot GET /
127.0.0.1:3000
(localhost
will no longer work as your browser will try to connect over IPv6)After trying this just once, or perhaps after using
localhost
normally for a while, your browser will "helpfully" notice thatlocalhost
has an IPv6 equivalent, and switch to it permanently, requiring you to explicitly use127.0.0.1
if you want to actually connect to the server. This will cause development tools to complain about insecure HTTP because they think they are connecting to an external IP address.Expected behavior
App shows up normally over IPv6
Actual behavior
Cannot GET /