Cannot replace file on R2 using @convex-dev/r2
hi, I want to store translation files for my app on R2. So when new translations are published I need to replace the file on R2 using the following code:
I get the following error:
6/22/2025, 1:46:21 PM [CONVEX A(changeset:storeBlobForBaseline)] Uncaught Error: Metadata already exists for key translations/ms.json. Please use a unique key.
at store [as store] (../node_modules/@convex-dev/r2/src/client/index.ts:204:81)
at async handler (../convex/changeset.ts:222:17)
I know I can delete the file and store it again, but do you know a better way?
4 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
That's fair, it should be possible to overwrite. If you open an issue on the repo I can get to it, or feel free to PR (or just run a fork) if you need it sooner.
GitHub
Replace file on R2 using @convex-dev/r2 · Issue #3 · erquhart/con...
hi, I want to store translation files for my app on R2. So when new translations are published I need to replace the file on R2 using the following code: const json = JSON.stringify(translations); ...
thank you ❤️