Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Run wrangler dev locally #1820

Closed
RaeesBhatti opened this issue Mar 21, 2021 · 4 comments
Closed

Run wrangler dev locally #1820

RaeesBhatti opened this issue Mar 21, 2021 · 4 comments
Labels
feature Feature requests and suggestions investigate timed out

Comments

@RaeesBhatti
Copy link

💡 Feature request

Describe the feature

It seems like my requests to wrangler dev are being routed to Cloudflare servers. This is causing unnecessary latency in when I make the changes and when they're realized in the server (~4-5 seconds). wrangler dev should run locally on local assets.

Describe the alternatives

Right now I'm stuck on a 500 Internal Server Error on all static resources. I'm not sure if I'm supposed to use https://github.com/cloudflare/kv-asset-handler locally or not or how to set it up in a wrangler dev setup. Do I have to upload the static files to KV before running wrangler dev?

@RaeesBhatti RaeesBhatti added the feature Feature requests and suggestions label Mar 21, 2021
@dgitq
Copy link

dgitq commented Apr 24, 2021

I agree fully! There should be a way to develop and run tests locally without the requests being routed to the Cloudfare edge..
Never really understood why Cloudflare neglected this and usually points to 'wrangler preview/dev' as a replacement for a proper local environment. Back in the day there was support by the community but it is not maintained any more: https://github.com/dollarshaveclub/cloudworker

Other cloud providers such as Azure have support for local development environments. There should be an official support maintained by Cloudflare @rita3ko :)

In the mean time you can look into jdanyow's packages collection:
#1321
https://github.com/cfworker/cfworker

Oh yea, and there are so many issues with wrangler login, timeouts, bad gateways and panick, that would be mitigated with local development environment:
#1703
https://github.com/cloudflare/wrangler/issues?q=panick

Thanks!

@RaeesBhatti
Copy link
Author

I've since published https://github.com/RaeesBhatti/cloudflare-kv-isomorphic which emulates Cloudflare KV API's when running locally on NodeJS. This allows me to develop the site without wrangler dev. It might be useful to some people.

@stale
Copy link

stale bot commented Jan 9, 2022

This issue has been automatically marked as stale because it has not had recent activity in the last 180 days. It will be closed if no further activity occurs in the next week. Please feel free to comment if you'd like it to remain open, and thank you for your contributions.

@stale stale bot added the timed out label Jan 9, 2022
@RaeesBhatti
Copy link
Author

I guess this is no longer relevant with the new miniflare release

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Feature requests and suggestions investigate timed out
Projects
None yet
Development

No branches or pull requests

3 participants