ยฉ 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developersโ€ข3y agoโ€ข
13 replies
fs0x30

Wrangler R2 local emulation

I'm working on a project locally and i cannot get the worker to emulate an R2 bucket locally. It works if I use --remote but I want to be able to just use it locally.

        // Adding a timeout for the put operation
        const timeout = new Promise<Response>((_, reject) => {
            const id = setTimeout(() => {
                clearTimeout(id);
                reject(new Response('Request timed out', { status: 408 }));
            }, 30000); // 30 seconds timeout
        });

        const putOperation = c.env.MY_BUCKET.put(key, data);

        await Promise.race([timeout, putOperation]);
        // Adding a timeout for the put operation
        const timeout = new Promise<Response>((_, reject) => {
            const id = setTimeout(() => {
                clearTimeout(id);
                reject(new Response('Request timed out', { status: 408 }));
            }, 30000); // 30 seconds timeout
        });

        const putOperation = c.env.MY_BUCKET.put(key, data);

        await Promise.race([timeout, putOperation]);


just seem to time out every time locally.
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

R2 Notification -> Queue -> Consumer in local development (wrangler.toml)
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
14mo ago
NextJS+Wrangler+R2 setup for local development without remote bucket
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
4mo ago
wrangler.toml r2_buckets binding
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago