Populating Convex data from Node.js
Hi guys I just started using convex and want to test out its potential for a large web app, if I want to populate my convex database from react api calls, there are almost 100k records but after some inserts the convex backend breaks showing this error :
Network error connecting to dev deployment: read ECONNRESET
If there is a way to build api calls service like node in convex or just the backend contains queries, subsscriptions, etc.?
8 Replies
Yep, you can use the http client https://docs.convex.dev/api/classes/browser.ConvexHttpClient from a Node.js script to populate the database.
Class: ConvexHttpClient | Convex Developer Hub
browser.ConvexHttpClient
this error
Network error connecting to dev deployment: read ECONNRESET
sounds to me like the dev deployment proxy stopped working. try rerunning npx convex dev
?If there is a way to build api calls service like node in convex@ballingt 's suggestion should let you call Convex queries and mutations from within Node. But if you want Convex itself to run the Node API calls, check out Actions https://docs.convex.dev/using/actions
Actions | Convex Developer Hub
Example:
ah actually the
Network error connecting to dev deployment: read ECONNRESET
looks like a bug on our side. working on it. thanks for reporting!@ProBro if you wouldn't mind sharing the code you used to populate the database from react api calls, I'm curious about it nevermind, as Lee says it's on our side! Let us know how running from Node.js or a Convex Action goes.
@ProBro seems like the issue on our side was a red herring and our hypothesis is that your the dev deployment proxy stopped working. Can you try restarting
npx convex dev
and let us know if it works?Here's a snapshot of my code so you can have an overall idea, i tried with npx convex dev but as the api calls increase the error persists.

I would like to take a closer look at your deployments. Do you mind sharing the email you registered with in private message? Alternatively, can you give us your prodUrl (it is located in convex.json).