I deployed a simple first version of a Sveltekit project successfully. After that I wanted to log into a database every time the site is accessed. For this, I created a Postgres database and table using Neon, linking it to my project for all three environments (dev, preview, prod). Then as instructed in the Getting started -> SvelteKit section I added @vercel/postgres to my project and used its sql function to insert some entries.
On my local system, appending the POSTGRES_URL to my .env file and running vercel dev, everything works as expected and I can see the database filling.
However, deploying to vercel, it works less often that not. Most of the calls to Neon fail with an Unhandled Rejection: NeonDbError: Error connecting to database: fetch failed. I would say 80% of the time it fails with this error, 10% of the time it doesn't but I've got no entry to DB, and the last 10% I've got one. I can't tell any pattern to those errors.
I checked that the database's environment variables do appear in the project settings automatically, and tried a couple times already to unlink / link the database to the project again.
Did I miss a step or a piece of knowledge?
I am unable to get guidance using that official example since the Github's link is dead and its demo links to a Prisma project 🤔 : https://vercel.com/new/pages-projects/templates/svelte/postgres-sveltekit
Unhandled Rejection: NeonDbError: Error connecting to database: fetch failed at execute (file:///var/task/node_modules/@neondatabase/serverless/index.mjs:1545:25) at processTicksAndRejections (node:internal/process/task_queues:95:5) at runNextTicks (node:internal/process/task_queues:64:3) at process.processImmediate (node:internal/timers:454:9) at process.callbackTrampoline (node:internal/async_hooks:130:17) { severity: undefined, code: undefined, detail: undefined, hint: undefined, position: undefined, internalPosition: undefined, internalQuery: undefined, where: undefined, schema: undefined, table: undefined, column: undefined, dataType: undefined, constraint: undefined, file: undefined, line: undefined, routine: undefined, sourceError: TypeError: fetch failed at node:internal/deps/undici/undici:13185:13 at processTicksAndRejections (node:internal/process/task_queues:95:5) at runNextTicks (node:internal/process/task_queues:64:3) at process.processImmediate (node:internal/timers:454:9) at process.callbackTrampoline (node:internal/async_hooks:130:17) at async execute (file:///var/task/node_modules/@neondatabase/serverless/index.mjs:1544:21) { [cause]: ConnectTimeoutError: Connect Timeout Error (attempted addresses: ...:, ...:, ...:*) at onConnectTimeout (node:internal/deps/undici/undici:2331:28) at node:internal/deps/undici/undici:2283:50 at Immediate._onImmediate (node:internal/deps/undici/undici:2315:13) at process.processImmediate (node:internal/timers:483:21) at process.callbackTrampoline (node:internal/async_hooks:130:17) { code: 'UND_ERR_CONNECT_TIMEOUT' } } } Node.js process exited with exit status: 128. The logs above can help with debugging the issue.

