Interacting with R2 Buckets During Local Development

I'm working on a project that involves uploading images to R2 buckets and then dynamically generating pages that display these images. However, I'm encountering challenges with simulating this interaction in my local development environment. I've attempted using wrangler pages dev combined with RPC service bindings to fetch a worker locally, but it seems to fall short unless I initiate a wrangler dev session specifically for the worker that handles the export. This method, however, hits another roadblock since the worker requires wrangler dev --remote to interact with R2 or Vectorize. Unfortunately, initiating wrangler dev with the --remote flag makes it invisible to wrangler pages dev. To sum up, I'm looking for a way to effectively test the upload and page generation process locally without deploying every change. The lack of a "next dev --remote" or "wrangler pages dev --remote" seems to complicate the process. Does anyone have experience or advice on how to tackle this?
1 Reply
thipperz
thipperzOP9mo ago
regarding this, I created this issue: https://github.com/cloudflare/workers-sdk/issues/5578
GitHub
🚀 Feature Request: Allow local Service Bindings to proxy to a `wran...
Describe the solution When I try to acess a rpc Service Binding in my next-on-pages application: Error: Cannot access 'ImageSearch' as we couldn't find a 'wrangler dev' session ...
Want results from more Discord servers?
Add your server