-
Notifications
You must be signed in to change notification settings - Fork 736
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
🐛 BUG: wrangler dev
doesn't work with KV on Node.JS >= 18
#3515
Comments
Hey! 👋 Thanks for reporting this, and including a reproduction! 😃 I'm able to reproduce this with Wrangler, but not using Miniflare directly, which is very interesting. Will try dig into this more now. 👍 |
Seems like removing |
@mrbbot , thanks a lot for the extra fast response, it's a great feeling coming back from lunch with ready work-around. |
Miniflare starts its loopback server on the same host as the `workerd` server, so it's accessible on all the same addresses as the runtime. This allows the loopback server to be the target for the live reload web socket. This means if the `host: "localhost"` option is set, we start a Node `http` server with `localhost` as the hostname. Node will perform a DNS lookup to work out which IP address and interface to listen on, but will only listen on the first entry. In Node 17+, this will be the IPv6 interface. Unfortunately, we previously hardcoded the loopback address as the IPv4 loopback, meaning `workerd` was unable to connect. This change switches to using `localhost`, which `workerd` will resolve to either IPv4 or v6. Closes cloudflare/workers-sdk#3515
Miniflare starts its loopback server on the same host as the `workerd` server, so it's accessible on all the same addresses as the runtime. This allows the loopback server to be the target for the live reload web socket. This means if the `host: "localhost"` option is set, we start a Node `http` server with `localhost` as the hostname. Node will perform a DNS lookup to work out which IP address and interface to listen on, but will only listen on the first entry. In Node 17+, this will be the IPv6 interface. Unfortunately, we previously hardcoded the loopback address as the IPv4 loopback, meaning `workerd` was unable to connect. This change switches to using `localhost`, which `workerd` will resolve to either IPv4 or v6. Closes cloudflare/workers-sdk#3515
Miniflare starts its loopback server on the same host as the `workerd` server, so it's accessible on all the same addresses as the runtime. This allows the loopback server to be the target for the live reload web socket. This means if the `host: "localhost"` option is set, we start a Node `http` server with `localhost` as the hostname. Node will perform a DNS lookup to work out which IP address and interface to listen on, but will only listen on the first entry. In Node 17+, this will be the IPv6 interface. Unfortunately, we previously hardcoded the loopback address as the IPv4 loopback, meaning `workerd` was unable to connect. This change switches to using `localhost`, which `workerd` will resolve to either IPv4 or v6. Closes #3515
Miniflare starts its loopback server on the same host as the `workerd` server, so it's accessible on all the same addresses as the runtime. This allows the loopback server to be the target for the live reload web socket. This means if the `host: "localhost"` option is set, we start a Node `http` server with `localhost` as the hostname. Node will perform a DNS lookup to work out which IP address and interface to listen on, but will only listen on the first entry. In Node 17+, this will be the IPv6 interface. Unfortunately, we previously hardcoded the loopback address as the IPv4 loopback, meaning `workerd` was unable to connect. This change switches to using `localhost`, which `workerd` will resolve to either IPv4 or v6. Closes #3515
Miniflare starts its loopback server on the same host as the `workerd` server, so it's accessible on all the same addresses as the runtime. This allows the loopback server to be the target for the live reload web socket. This means if the `host: "localhost"` option is set, we start a Node `http` server with `localhost` as the hostname. Node will perform a DNS lookup to work out which IP address and interface to listen on, but will only listen on the first entry. In Node 17+, this will be the IPv6 interface. Unfortunately, we previously hardcoded the loopback address as the IPv4 loopback, meaning `workerd` was unable to connect. This change switches to using `localhost`, which `workerd` will resolve to either IPv4 or v6. Closes #3515
Miniflare starts its loopback server on the same host as the `workerd` server, so it's accessible on all the same addresses as the runtime. This allows the loopback server to be the target for the live reload web socket. This means if the `host: "localhost"` option is set, we start a Node `http` server with `localhost` as the hostname. Node will perform a DNS lookup to work out which IP address and interface to listen on, but will only listen on the first entry. In Node 17+, this will be the IPv6 interface. Unfortunately, we previously hardcoded the loopback address as the IPv4 loopback, meaning `workerd` was unable to connect. This change switches to using `localhost`, which `workerd` will resolve to either IPv4 or v6. Closes #3515
Which Cloudflare product(s) does this pertain to?
KV
What version of
Wrangler
are you using?3.1.1
What operating system are you using?
MacOS (13.2.1 (22D68)), Ubuntu 22.04.2 LTS
Describe the Bug
Link to the repository with the code below.
Sample worker code I used for testing:
wrangler.toml
:Node.JS 16
Here it's the behavior on Node.JS 16. To make it work I:
nvm install 16.20.1
node_modules
:rm -rf ./node_modules
, remove npm cache:npm cache clean --force
npm i
npx wrangler dev --log-level=debug
Application starts and I can see the in the logs the
test-value
:Node.JS 18
Doing the same stuff as for 16 and I'm testing on 18.16.1 (on both MacOS and Ubuntu).
Output of
npx wrangler dev --log-level=debug
after making the first callAnd the response to this HTTP call is:
Severity of the problem
As far as we're using Queues, which are not supported on Node.JS 16, we can't use this version for local development:
The text was updated successfully, but these errors were encountered: