Convex does not accept certain JSON Files

if your json file looks like this:
[
{
"hi": "hi"
}
]
[
{
"hi": "hi"
}
]
so if you are using [] on the top. convex import does not accept the json file. One example of an json file that convex is not accepting I added here.
5 Replies
lee
lee•13mo ago
What error are you seeing? One restriction for json array files is they have a size limit, since Convex parses the array in memory. For larger imports you can reformat the file as JSONL
FleetAdmiralJakob 🗕 🗗 🗙
I get everytime a different error for the same file: One time I got this: 400 Bad Request: ImportFailed: Not valid JSON: EOF while parsing a value at line 500 column 15 another time I got this: 400 Bad Request: ImportFailed: Not valid JSON: EOF while parsing an object at line 86 column 3 for the linked city-list.json I will reformat it into jsonl
lee
lee•13mo ago
It sounds like the connection is dropping while uploading the file. This is a problem i have fixed on main but we haven't released the fix yet, sorry. Converting to jsonl will also help. I expect we'll fix the size limitations this week or early next week. Until then, you could consider splitting into multiple files and using --append
FleetAdmiralJakob 🗕 🗗 🗙
Ok, thank you for your quick answer. I mean that was fast. I love your product and cool that there is already a fix for that.
lee
lee•13mo ago
the issue of connections dropping during imports should be fixed now. Let me know how it goes! https://news.convex.dev/announcing-convex-1-9/
Convex News
Announcing Convex 1.9
Big Import and Export Improvements When we released ZIP file imports and exports in Convex 1.7, it wasn't long before industrious developers started hitting the limitations. We’ve got some big improvements for you. * File storage can now be included in Snapshot Export * Snapshot import via npx convex import

Did you find this page helpful?