I am trying to test locally getting a file from R2 bucket which i added via dashboard

I created a worker cron job and am testing locally via wrangler dev --test-scheduled. calling await env.MY_BUCKET.get('myfile.json'); returns null even though the file exists in my R2 bucket dashboard. Why is this the case?
Was this page helpful?