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]);


just seem to time out every time locally.
Was this page helpful?