Next.js Discord

Discord Forum


Oak saucer gall posted this in #help-forum
Open in Discord
Oak saucer gallOP
I'm using the vercel db. I'm able to create and update data in DB but not to delete it because server returns error:
VercelPostgresError: VercelPostgresError - 'missing_connection_string': You did not supply a 'connectionString' and no 'POSTGRES_URL' env var was found.
Since I'm able to insert data, why this error shows up and how to fix it?

Delete action code:
'use server'; import { sql } from '@vercel/postgres'; export async function deleteElement(element_id: string) { try { await sqlDELETE FROM expenses WHERE id = ${element_id}; } catch (error) { const errorMessage = error instanceof Error && error.message; console.log(error); return { error: error, message: errorMessage }; } }

1 Reply

Oak saucer gallOP
So I got from work and losing my mind. Restarted project and it works now. I can't even reproduce the error because I haven't changed anything since it occured. Anyway, I'm closing thread.