There are no special instructions for
There are no special instructions for migrating from Wrangler v2 to v3. You should be able to update Wrangler by following the instructions in Install/Update Wrangler. You should experience no disruption to your workflow.https://developers.cloudflare.com/workers/wrangler/migration/update-v2-to-v3/
15 Replies
Thanks for raising this issue. You're right that we should update the docs to reflect these changes better. I've added an issue in the docs to track: https://github.com/cloudflare/cloudflare-docs/issues/10721
GitHub
[workers] update v2 to v3 migration guide to reflect dev workflow c...
Which Cloudflare product does this pertain to? Workers Existing documentation URL(s) https://developers.cloudflare.com/workers/wrangler/migration/update-v2-to-v3 What changes are you suggesting? up...
thanks! any idea if
request.headers.get("cf-connecting-ip")
being null
is intended or if there is something else I should be using? I'd like to not have to add a special handling for this in dev mode. also I just want to make sure it will still work when deployed to prod (it is just a local change right?)Not an ideal solution, but you could run it through a Quick Tunnel for local dev?
for my use case I can just hardcode
127.0.0.1
or something in dev (its for rate limiting and anon usage tracking)it is intended. however, that change is just a miniflare change - so just dev mode. in v2 we set that on incoming requests, but we don't in v3. i'll make sure to update that in the docs.
I think it would be good to add it back, in my opinion miniflare and a "real worker" should be as similar as possible
Is there another way of getting the incoming IP from within a Worker?
miniflare and a "real worker" should be as similar as possiblethat is exactly what we're after. i'll need some time to explore why we made that change in the first place.
I literally can't find the IP anywhere in the headers or the cf object on the request in local dev
I think it's getting removed here: https://github.com/cloudflare/miniflare/blob/f919a2eaccf30d63f435154969e4233aa3b9531c/packages/core/src/standards/http.ts#L857
GitHub
miniflare/packages/core/src/standards/http.ts at f919a2eaccf30d63f4...
🔥 Fully-local simulator for Cloudflare Workers. Contribute to cloudflare/miniflare development by creating an account on GitHub.
Isn’t that only for outbound fetch? That shouldn’t affect the incoming Request, no?
Ah...that makes sense. It could be a bug then. I see it mentioned here too: https://github.com/cloudflare/miniflare/blob/f919a2eaccf30d63f435154969e4233aa3b9531c/packages/http-server/src/index.ts#L90
GitHub
miniflare/packages/http-server/src/index.ts at f919a2eaccf30d63f435...
🔥 Fully-local simulator for Cloudflare Workers. Contribute to cloudflare/miniflare development by creating an account on GitHub.
Yeah, looks like that should™️ be adding it?
weird, I don't get
x-real-ip
eitherCould you file an issue in the miniflare repo with those missing, but expected headers?