Your Server Action Error Messages Vanish in Production, and Throwing Is the Wrong Tool

typescript dev.to

Here is a bug report you will eventually get: "The signup form told me what was wrong on your machine, but on the live site it just says something went wrong." Nothing is broken. Next.js is doing this on purpose. But the code that triggers it looks completely normal, and it is in a lot of Server Actions tutorials, including a version in my own earlier post on replacing API routes. The Code That Works Locally // actions/signup.ts 'use server'; export async function signup(formDat

Read Full Tutorial open_in_new
arrow_back Back to Tutorials