Sequelize on Cloudflare Workers is indefinitely hanging

Sequelize seems to indefinitely hang on Cloudflare Workers with no error messages. Does anyone know if there is a workaround or if it's just not compatible? I've already set the following in my wrangler.toml
compatibility_flags = [ "nodejs_compat" ]
compatibility_date = "2024-09-23"
compatibility_flags = [ "nodejs_compat" ]
compatibility_date = "2024-09-23"
1 Reply
ajgeiss0702
ajgeiss07026d ago
are you trying to use it with cloudflare's D1? or an external provider also, are you initializing the database in the global scope or in the first request? In workers, initializing things that require external services in the global scope is ill-advised if you haven't already, also look into using hyperdrive if possible. I haven't used it myself since I just use D1, but it might come with some improvements to connecting to databases from workers that you may find worthwile. I should note that I have never used Sequelize and know very little about it. If they have a community server, it might be worthwile to ask there too if anyone has had success running it on workers

Did you find this page helpful?