Open lamualfa opened 11 months ago
Hey! 👋 Thanks for raising this. A couple things to try:
console.log(error)
with console.log(error.stack)
? That might include some more information. Also try logging error.cause?.stack
.@mrbbot
Have you applied migrations (if any) to your remote database?
Yes I have.
Could you try replacing console.log(error) with console.log(error.stack)? That might include some more information. Also try logging error.cause?.stack.
The error caught by try catch
is undefined
.
The interesting thing that I found was, that the insert many functions in drizzle will produce an error if I insert many rows in a single query. My current solution is to break it up into small rows and execute insert many functions many times.
I don't need to do that when running it locally using wrangler
. The error only occurs in Cloudflare server. So I guess there's a limitation of the size of the query in single execution when using D1 in the Cloudflare server.
So I guess there's a limitation of the size of the query in single execution when using D1 in the Cloudflare server.
That's a great insight. 😃 It looks like there are some limits here we should be enforcing locally too: https://developers.cloudflare.com/d1/platform/limits/.
Which Cloudflare product(s) does this pertain to?
D1
What version(s) of the tool(s) are you using?
wrangler
2.20.1
drizzle-orm
0.29.1
typescript
4.9.5
itty-router
4.0.23
better-sqlite3
9.2.2
What version of Node are you using?
21
What operating system are you using?
Linux
Describe the Bug
The workers work well locally when using
wrangler dev --local --persist
. But it gives an error when running it on Cloudflare after deploying it usingwrangler publish
.Please provide a link to a minimal reproduction
Please provide any relevant error logs